summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@mail.utexas.edu>2001-08-25 23:47:18 +0000
committerPhilip Langdale <philipl@src.gnome.org>2001-08-25 23:47:18 +0000
commit9d54a20f18a64d5999d531ae02ea62a444ffcfeb (patch)
treea20cb7761c9c980b37007503f61bd0cab04523b3
parentd646d9d7ac30a2839460cf4feca5838baef36b81 (diff)
downloadyelp-9d54a20f18a64d5999d531ae02ea62a444ffcfeb.tar.gz
Duplicated INFOPATH before passing to strtok to prevent actual env var
2001-08-25 Philip Langdale <philipl@mail.utexas.edu> * gnome-info2html2/main.c: Duplicated INFOPATH before passing to strtok to prevent actual env var getting corrupted.
-rw-r--r--src/info2html/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/info2html/main.c b/src/info2html/main.c
index eb8893ac..5ccc70b8 100644
--- a/src/info2html/main.c
+++ b/src/info2html/main.c
@@ -77,7 +77,9 @@ main(int argc, char **argv)
for(n = 0; args[n]; n++) /* */;
if(n == 1 && !file_exists(args[0]))
{
- char *ctmp, *infopath = g_getenv("INFOPATH");
+ /* As strtok destroys the string it parses and g_getenv returns a pointer to
+ the actually env var, we have to duplicate the var before parsing it. */
+ char *ctmp, *infopath = g_strdup(g_getenv("INFOPATH"));
char *dirs[64], *ext = NULL;
int ndirs;
char buf[PATH_MAX];