* libmisc/shell.c: Add brackets and parenthesis.

* libmisc/shell.c: Avoid assignments in comparisons.
	* libmisc/shell.c: Re-indent.
This commit is contained in:
nekral-guest 2009-04-21 22:07:35 +00:00
parent c8f45eda53
commit 408a30f0ba
2 changed files with 12 additions and 5 deletions

View File

@ -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.

View 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);
}
}
}