From 11f5b06579ab0ae45ff137db29b9d0b4cd9c3d03 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sun, 16 Apr 2000 10:53:02 +0000 Subject: * libc/posix/execvp.c (execvp): Check path for trailing slash. --- newlib/libc/posix/execvp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'newlib/libc/posix/execvp.c') diff --git a/newlib/libc/posix/execvp.c b/newlib/libc/posix/execvp.c index 6957f61..15b2e57 100644 --- a/newlib/libc/posix/execvp.c +++ b/newlib/libc/posix/execvp.c @@ -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) -- cgit v1.1