From 400e6fc264cbe6ca3ca572d94bbf5f929f256713 Mon Sep 17 00:00:00 2001 From: Manuel Novoa III Date: Fri, 2 Jan 2004 08:44:58 +0000 Subject: Redo the exec functions to comply with SUSv3. --- libc/unistd/execvep.c | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 libc/unistd/execvep.c (limited to 'libc/unistd/execvep.c') diff --git a/libc/unistd/execvep.c b/libc/unistd/execvep.c deleted file mode 100644 index 6cd8cbaf9..000000000 --- a/libc/unistd/execvep.c +++ /dev/null @@ -1,46 +0,0 @@ -#include -#include -#include -#include -#include - -int execvep(const char *path, char *__const argv[], char *__const envp[]) -{ - if (!strchr(path, '/')) { - char *p = getenv("PATH"); - - if (!p) - p = "/bin:/usr/bin"; - - for (; p && *p;) { - char partial[FILENAME_MAX]; - char *p2; - - p2 = strchr(p, ':'); - if (p2) { - size_t len = p2 - p; - strncpy(partial, p, len); - partial[len] = 0; - } else { - strcpy(partial, p); - } - - if (strlen(partial)) - strcat(partial, "/"); - strcat(partial, path); - - execve(partial, argv, envp); - - if (errno != ENOENT) - return -1; - - if (p2) { - p = p2 + 1; - } else { - p = 0; - } - } - return -1; - } else - return execve(path, argv, envp); -} -- cgit v1.2.3