summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-08-22 02:34:16 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-08-22 02:34:16 +0000
commit2b9cc518c5dc8c5d806d60cede96deaf84920b09 (patch)
treedb076319f309af0bdfb4752a13e4965c562cf0a1
parentImprove finding of python (bug #281933). (diff)
downloadeselect-python-2b9cc518c5dc8c5d806d60cede96deaf84920b09.tar.gz
eselect-python-2b9cc518c5dc8c5d806d60cede96deaf84920b09.tar.bz2
eselect-python-2b9cc518c5dc8c5d806d60cede96deaf84920b09.zip
Fix argv[0] (bug #281971).
-rw-r--r--python-wrapper.c5
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;
}