diff options
Diffstat (limited to 'lib/libc/gen/exec.c')
-rw-r--r-- | lib/libc/gen/exec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c index 2410ce9..72b6db4 100644 --- a/lib/libc/gen/exec.c +++ b/lib/libc/gen/exec.c @@ -200,6 +200,12 @@ execvp(name, argv) } bp = buf; + /* If it's an empty path name, fail in the usual POSIX way. */ + if (*name == '\0') { + errno = ENOENT; + return (-1); + } + /* Get the path we're searching. */ if (!(path = getenv("PATH"))) path = _PATH_DEFPATH; |