From: nekral-guest Date: Tue, 21 Apr 2009 22:07:35 +0000 (+0000) Subject: * libmisc/shell.c: Add brackets and parenthesis. X-Git-Tag: 4.1.4~149 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=408a30f0ba7c28e2a7972e7ee17cbc1ad597be5e;p=shadow * libmisc/shell.c: Add brackets and parenthesis. * libmisc/shell.c: Avoid assignments in comparisons. * libmisc/shell.c: Re-indent. --- diff --git a/ChangeLog b/ChangeLog index 66bd0cf5..ee9f1d1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ -2009-04-20 Nicolas François +2009-04-21 Nicolas François + + * libmisc/shell.c: Add brackets and parenthesis. + * libmisc/shell.c: Avoid assignments in comparisons. + * libmisc/shell.c: Re-indent. + +2009-04-21 Nicolas François * lib/defines.h: Added MIN and MAX macros. * libmisc/salt.c: Removed MIN and MAX macros. diff --git a/libmisc/shell.c b/libmisc/shell.c index 04c04808..26b0eb33 100644 --- a/libmisc/shell.c +++ b/libmisc/shell.c @@ -94,14 +94,15 @@ int shell (const char *file, const char *arg, char *const envp[]) if (err == ENOEXEC) { FILE *fp; - if ((fp = fopen (file, "r"))) { + fp = fopen (file, "r"); + if (NULL != fp) { if (getc (fp) == '#' && getc (fp) == '!') { - fclose (fp); + (void) fclose (fp); execle ("/bin/sh", "sh", - file, (char *) 0, envp); + file, (char *) 0, envp); err = errno; } else { - fclose (fp); + (void) fclose (fp); } } }