Commit 3b5b5e54 authored by Emmanuel Thomé's avatar Emmanuel Thomé

Revert "protect path_resolve in case it overwrites $PATH"

This reverts commit ff2e5dd7.
parent ff2e5dd7
......@@ -163,7 +163,6 @@ int set_antebuffer_path (const char *executable_filename, const char *path_anteb
return 1;
}
fprintf(stderr, "No antebuffer configured\n");
*antebuffer='\0'; /* in case path_resolve leaves crap around */
return 0;
}
......
......@@ -258,8 +258,6 @@ char * path_resolve(const char * progname, char * resolved)
char * path = getenv("PATH");
if (!path) return 0;
char * next_path;
char * path0 = strdup(path);
path = path0;
for( ; *path ; path = next_path) {
next_path = strchr(path, ':');
if (next_path) {
......@@ -273,12 +271,9 @@ char * path_resolve(const char * progname, char * resolved)
#else
snprintf(dummy2, PATH_MAX, "%s/%s", path, progname);
#endif
if (realpath(dummy2, resolved)) {
free(path0);
if (realpath(dummy2, resolved))
return resolved;
}
}
free(path0);
return NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment