aboutsummaryrefslogtreecommitdiff
path: root/posix/execvp.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-10-22 11:49:29 +0000
committerUlrich Drepper <drepper@redhat.com>1998-10-22 11:49:29 +0000
commit9271a050b5af6594ab112a9c116854953b041d8f (patch)
tree4e858e3b7bedaaba8122e7ef378313192ae9653f /posix/execvp.c
parente595c802ca9a9eb2c7d5e72cb7b9437d25063c97 (diff)
downloadglibc-9271a050b5af6594ab112a9c116854953b041d8f.zip
glibc-9271a050b5af6594ab112a9c116854953b041d8f.tar.gz
glibc-9271a050b5af6594ab112a9c116854953b041d8f.tar.bz2
Update.
1998-10-22 H.J. Lu <hjl@gnu.org> * sysdeps/unix/sysv/linux/i386/getgroups.c (__getgroups): Add sanity check for n. * sysdeps/unix/sysv/linux/i386/setgroups.c (setgroups): Likewise. * sysdeps/posix/fpathconf.c (__fpathconf): Set errno to EINVAL if errno == ENODEV. Tested by VSX-PCT. * sysdeps/posix/isatty.c (__isatty): Don't reset errno. Tested by VSX-PCT. * posix/execvp.c (execvp): Check "". Tested by VSX-PCT.
Diffstat (limited to 'posix/execvp.c')
-rw-r--r--posix/execvp.c9
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);