diff options
Diffstat (limited to 'posix/execvp.c')
-rw-r--r-- | posix/execvp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/posix/execvp.c b/posix/execvp.c index 5b1e14b..7afb01d 100644 --- a/posix/execvp.c +++ b/posix/execvp.c @@ -54,7 +54,7 @@ execute (const char *file, char *const argv[]) /* Execute the shell. */ execv (new_argv[0], new_argv); } - } + } } @@ -67,6 +67,13 @@ execvp (file, argv) { int got_eacces = 0; + if (*file == '\0') + { + /* We check the simple case first. */ + __set_errno (ENOENT); + return -1; + } + if (strchr (file, '/') != NULL) /* Don't search when it contains a slash. */ execute (file, argv); |