4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-19 04:49:25 +08:00

* 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

@ -1,3 +1,8 @@
Sun Apr 16 12:45:00 2000 Corinna Vinschen <corinna@vinschen.de>
* libc/posix/execvp.c (execvp): Check path for
trailing slash.
Fri Mar 31 20:39:00 2000 Corinna Vinschen <corinna@vinschen.de>
* libc/include/sys/unistd.h: Add prototypes for

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)