[project @ 2004-03-05 13:23:48 by jmb]

Fix memory leak when fgets fails.
Add debugging round early part of gui_init

svn path=/import/netsurf/; revision=583
This commit is contained in:
John Mark Bell 2004-03-05 13:23:48 +00:00
parent 0ea3e074f6
commit 0bb832d890
1 changed files with 15 additions and 2 deletions

View File

@ -132,16 +132,23 @@ void gui_init(int argc, char** argv)
char theme_fname[256]; char theme_fname[256];
os_error *error; os_error *error;
LOG(("starting hourglass"));
xhourglass_start(1); xhourglass_start(1);
LOG(("reading choices"));
options_read("Choices:WWW.NetSurf.Choices"); options_read("Choices:WWW.NetSurf.Choices");
LOG(("choosing language"));
ro_gui_choose_language(); ro_gui_choose_language();
LOG(("grabbing NetSurf$Dir from the environment"));
NETSURF_DIR = getenv("NetSurf$Dir"); NETSURF_DIR = getenv("NetSurf$Dir");
sprintf(path, "<NetSurf$Dir>.Resources.%s.Messages", option_language); sprintf(path, "<NetSurf$Dir>.Resources.%s.Messages", option_language);
LOG(("Loading messages from '%s'", path));
messages_load(path); messages_load(path);
LOG(("done"));
task_handle = wimp_initialise(wimp_VERSION_RO38, "NetSurf", task_handle = wimp_initialise(wimp_VERSION_RO38, "NetSurf",
(wimp_message_list*) &task_messages, 0); (wimp_message_list*) &task_messages, 0);
@ -829,7 +836,10 @@ void ro_msg_dataload(wimp_message *message)
fclose(fp); fclose(fp);
if (!temp) return; if (!temp) {
xfree(url);
return;
}
if (url[strlen(url)-1] == '\n') { if (url[strlen(url)-1] == '\n') {
url[strlen(url)-1] = '\0'; url[strlen(url)-1] = '\0';
@ -949,7 +959,10 @@ void ro_msg_dataopen(wimp_message *message)
fclose(fp); fclose(fp);
if (!temp) return; if (!temp) {
xfree(url);
return;
}
if (url[strlen(url)-1] == '\n') { if (url[strlen(url)-1] == '\n') {
url[strlen(url)-1] = '\0'; url[strlen(url)-1] = '\0';