From 408a30f0ba7c28e2a7972e7ee17cbc1ad597be5e Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Tue, 21 Apr 2009 22:07:35 +0000 Subject: [PATCH] * libmisc/shell.c: Add brackets and parenthesis. * libmisc/shell.c: Avoid assignments in comparisons. * libmisc/shell.c: Re-indent. --- ChangeLog | 8 +++++++- libmisc/shell.c | 9 +++++---- 2 files changed, 12 insertions(+), 5 deletions(-) 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); } } }