GNU bug report logs - #23153
[PATCH]: For FIXME in cp.c

Previous Next

Package: coreutils;

Reported by: Rishabh Dave <rishabhddave <at> gmail.com>

Date: Tue, 29 Mar 2016 21:11:01 UTC

Severity: normal

Tags: patch

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 23153 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Rishabh Dave <rishabhddave <at> gmail.com>, Pádraig Brady
 <P <at> draigbrady.com>
Cc: 23153 <at> debbugs.gnu.org
Subject: Re: bug#23153: [PATCH]: For FIXME in cp.c
Date: Mon, 4 Apr 2016 10:06:40 -0700
On 04/04/2016 09:30 AM, Rishabh Dave wrote:
> +  char *suffix_from_env;
>     size_t ssize;
>     bool simple = true;
>   
> +
> +  /* If simple_backup_suffix is '~', check environment if we have any there. */
> +  if (strcmp(simple_backup_suffix, "~") == 0)
> +    if ((suffix_from_env = getenv("SIMPLE_BACKUP_SUFFIX")) != NULL)
> +      simple_backup_suffix = xstrdup (suffix_from_env);
> +

The usual GNU style is "f (x)" rather than "f(x)" for function calls. 
Also, avoid side effects in an "if"; just have the then-part with a 
local variable "suffix_from_env" and put the subsidary if after that.




This bug report was last modified 8 years and 279 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.