* libc/posix/execvp.c (execvp): Check path for
trailing slash.
This commit is contained in:
		
							parent
							
								
									0ac91154fc
								
							
						
					
					
						commit
						11f5b06579
					
				|  | @ -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> | Fri Mar 31 20:39:00 2000  Corinna Vinschen <corinna@vinschen.de> | ||||||
| 
 | 
 | ||||||
|         * libc/include/sys/unistd.h: Add prototypes for |         * libc/include/sys/unistd.h: Add prototypes for | ||||||
|  |  | ||||||
|  | @ -73,7 +73,7 @@ _DEFUN (execvp, (file, argv), | ||||||
|     { |     { | ||||||
|       strccpy (buf, path, PATH_DELIM); |       strccpy (buf, path, PATH_DELIM); | ||||||
|       /* An empty entry means the current directory.  */ |       /* An empty entry means the current directory.  */ | ||||||
|       if (*buf != 0) |       if (*buf != 0 && buf[strlen(buf) - 1] != '/') | ||||||
| 	strcat (buf, "/"); | 	strcat (buf, "/"); | ||||||
|       strcat (buf, file); |       strcat (buf, file); | ||||||
|       if (execv (buf, argv) == -1 && errno != ENOENT) |       if (execv (buf, argv) == -1 && errno != ENOENT) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue