summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-08-14 18:38:02 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-08-14 18:38:02 +0000
commit5249a90319c027d7c9a42f91c56548845afcf577 (patch)
tree386b3b0522f3cb24c06cbdac63879ff34b7a2002
parentRename python.c to python-wrapper.c. (diff)
downloadeselect-python-5249a90319c027d7c9a42f91c56548845afcf577.tar.gz
eselect-python-5249a90319c027d7c9a42f91c56548845afcf577.tar.bz2
eselect-python-5249a90319c027d7c9a42f91c56548845afcf577.zip
Improve some code (bug #281308).
-rw-r--r--python-wrapper.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/python-wrapper.c b/python-wrapper.c
index 9704400..2291874 100644
--- a/python-wrapper.c
+++ b/python-wrapper.c
@@ -14,7 +14,7 @@
/* 127 is the standard return code for "command not found" */
#define EXIT_ERROR 127
-const char* program_description = "Gentoo Python wrapper program";
+const char program_description[] = "Gentoo Python wrapper program";
char* dir_cat(const char* dir, const char* file)
{
@@ -51,15 +51,6 @@ const char* find_path(const char* exe)
{
token = ".";
}
- /* If it starts with "~/", use "${HOME}/" instead */
- if (strncmp(token, "~/", 2) == 0)
- {
- char* home = getenv("HOME");
- char* new_token = malloc(strlen(token) + strlen(home));
- strcpy(new_token, home);
- strcat(new_token, token + 1);
- token = new_token;
- }
struct stat sbuf;
char* str = dir_cat(token, exe);
if (stat(str, &sbuf) == 0 && (S_ISREG(sbuf.st_mode) || S_ISLNK(sbuf.st_mode)))