diff options
author | 2009-08-22 02:34:16 +0000 | |
---|---|---|
committer | 2009-08-22 02:34:16 +0000 | |
commit | 2b9cc518c5dc8c5d806d60cede96deaf84920b09 (patch) | |
tree | db076319f309af0bdfb4752a13e4965c562cf0a1 | |
parent | Improve finding of python (bug #281933). (diff) | |
download | eselect-python-2b9cc518c5dc8c5d806d60cede96deaf84920b09.tar.gz eselect-python-2b9cc518c5dc8c5d806d60cede96deaf84920b09.tar.bz2 eselect-python-2b9cc518c5dc8c5d806d60cede96deaf84920b09.zip |
Fix argv[0] (bug #281971).
-rw-r--r-- | python-wrapper.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/python-wrapper.c b/python-wrapper.c index 8acda53..7be15fc 100644 --- a/python-wrapper.c +++ b/python-wrapper.c @@ -199,6 +199,7 @@ int main(__attribute__((unused)) int argc, char** argv) if (strchr(EPYTHON, '/')) { + argv[0] = (char*) EPYTHON; execv(EPYTHON, argv); return EXIT_ERROR; } @@ -206,10 +207,12 @@ int main(__attribute__((unused)) int argc, char** argv) const char* path = find_path(argv[0]); if (*path) { - execv(dir_cat(path, EPYTHON), argv); + argv[0] = dir_cat(path, EPYTHON); + execv(argv[0], argv); /* If this failed, then just search the PATH. */ } + argv[0] = (char*) EPYTHON; execvp(EPYTHON, argv); return EXIT_ERROR; } |