* libmisc/shell.c: Add brackets and parenthesis.
* libmisc/shell.c: Avoid assignments in comparisons. * libmisc/shell.c: Re-indent.
This commit is contained in:
parent
c8f45eda53
commit
408a30f0ba
@ -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.
|
* lib/defines.h: Added MIN and MAX macros.
|
||||||
* libmisc/salt.c: Removed MIN and MAX macros.
|
* libmisc/salt.c: Removed MIN and MAX macros.
|
||||||
|
@ -94,14 +94,15 @@ int shell (const char *file, const char *arg, char *const envp[])
|
|||||||
if (err == ENOEXEC) {
|
if (err == ENOEXEC) {
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
if ((fp = fopen (file, "r"))) {
|
fp = fopen (file, "r");
|
||||||
|
if (NULL != fp) {
|
||||||
if (getc (fp) == '#' && getc (fp) == '!') {
|
if (getc (fp) == '#' && getc (fp) == '!') {
|
||||||
fclose (fp);
|
(void) fclose (fp);
|
||||||
execle ("/bin/sh", "sh",
|
execle ("/bin/sh", "sh",
|
||||||
file, (char *) 0, envp);
|
file, (char *) 0, envp);
|
||||||
err = errno;
|
err = errno;
|
||||||
} else {
|
} else {
|
||||||
fclose (fp);
|
(void) fclose (fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user