* libc/posix/execvp.c (execvp): Check path for

trailing slash.
This commit is contained in:
Corinna Vinschen
2000-04-16 10:53:02 +00:00
parent 0ac91154fc
commit 11f5b06579
2 changed files with 6 additions and 1 deletions

View File

@ -73,7 +73,7 @@ _DEFUN (execvp, (file, argv),
{
strccpy (buf, path, PATH_DELIM);
/* An empty entry means the current directory. */
if (*buf != 0)
if (*buf != 0 && buf[strlen(buf) - 1] != '/')
strcat (buf, "/");
strcat (buf, file);
if (execv (buf, argv) == -1 && errno != ENOENT)