diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c index b62ae63e6fd0..2410ce974492 100644 --- a/lib/libc/gen/exec.c +++ b/lib/libc/gen/exec.c @@ -190,6 +190,8 @@ execvp(name, argv) int eacces, etxtbsy; char *bp, *cur, *path, buf[MAXPATHLEN]; + eacces = etxtbsy = 0; + /* If it's an absolute or relative path name, it's easy. */ if (index(name, '/')) { bp = (char *)name; @@ -203,7 +205,6 @@ execvp(name, argv) path = _PATH_DEFPATH; cur = path = strdup(path); - eacces = etxtbsy = 0; while ( (p = strsep(&cur, ":")) ) { /* * It's a SHELL path -- double, leading and trailing colons