]> granicus.if.org Git - shadow/commitdiff
* libmisc/shell.c: Add brackets and parenthesis.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Tue, 21 Apr 2009 22:07:35 +0000 (22:07 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Tue, 21 Apr 2009 22:07:35 +0000 (22:07 +0000)
* libmisc/shell.c: Avoid assignments in comparisons.
* libmisc/shell.c: Re-indent.

ChangeLog
libmisc/shell.c

index 66bd0cf5d0df1c3cabf7e8b17fb31aa85c59777c..ee9f1d1f3ef1c49fca2da5de322d3e96735cae4f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-2009-04-20  Nicolas François  <nicolas.francois@centraliens.net>
+2009-04-21  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * 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  <nicolas.francois@centraliens.net>
 
        * lib/defines.h: Added MIN and MAX macros.
        * libmisc/salt.c: Removed MIN and MAX macros.
index 04c048089a9c4660d35986c5c5c4e031e175f41a..26b0eb33eed7376cf4d4fecd1d3c278f2b0f007b 100644 (file)
@@ -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);
                        }
                }
        }