[project @ 2005-03-20 01:55:48 by jmb]

Explicitly copy result of getenv(NetSurf$Dir) as not doing so will break things with latest UnixLib (as the result gets freed next time getenv is called).

svn path=/import/netsurf/; revision=1549
This commit is contained in:
John Mark Bell 2005-03-20 01:55:48 +00:00
parent 154e904fcc
commit 4777e75682

View File

@ -187,6 +187,7 @@ void gui_init(int argc, char** argv)
os_error *error; os_error *error;
int length; int length;
struct theme_descriptor *descriptor = NULL; struct theme_descriptor *descriptor = NULL;
char *nsdir_temp;
xhourglass_start(1); xhourglass_start(1);
@ -226,7 +227,11 @@ void gui_init(int argc, char** argv)
url_store_load("Choices:WWW.NetSurf.URL"); url_store_load("Choices:WWW.NetSurf.URL");
NETSURF_DIR = getenv("NetSurf$Dir"); nsdir_temp = getenv("NetSurf$Dir");
if (!nsdir_temp)
die("Failed to locate NetSurf directory");
NETSURF_DIR = strdup(nsdir_temp);
if ((length = snprintf(path, sizeof(path), if ((length = snprintf(path, sizeof(path),
"<NetSurf$Dir>.Resources.%s.Messages", "<NetSurf$Dir>.Resources.%s.Messages",
option_language)) < 0 || length >= (int)sizeof(path)) option_language)) < 0 || length >= (int)sizeof(path))