Add logging

svn path=/trunk/netsurf/; revision=3242
This commit is contained in:
John Mark Bell 2007-04-07 17:58:42 +00:00
parent 4d55f43a3d
commit cc0f1c7e28

View File

@ -224,7 +224,14 @@ void history_add(struct history *history, struct content *content,
warn_user("NoMemory", 0); warn_user("NoMemory", 0);
return; return;
} }
LOG(("%s => %s : %s", content->url, url, content->title));
LOG(("%s", frag_id));
title = strdup(content->title ? content->title : url); title = strdup(content->title ? content->title : url);
LOG(("after strdup"));
if (!entry || !url || !title) { if (!entry || !url || !title) {
warn_user("NoMemory", 0); warn_user("NoMemory", 0);
free(entry); free(entry);
@ -400,9 +407,20 @@ void history_go(struct browser_window *bw, struct history *history,
char *url; char *url;
struct history_entry *current; struct history_entry *current;
LOG(("%p %p %p", bw, history, entry));
LOG(("%s %s %s",
entry->page.url, entry->page.title, entry->page.frag_id));
if (entry->page.frag_id) { if (entry->page.frag_id) {
url = malloc(strlen(entry->page.url) + size_t a, b;
strlen(entry->page.frag_id) + 5);
a = strlen(entry->page.url);
LOG(("after a"));
b = strlen(entry->page.frag_id);
LOG(("after b"));
url = malloc(a + b + 5);
LOG(("after malloc"));
if (!url) { if (!url) {
warn_user("NoMemory", 0); warn_user("NoMemory", 0);
return; return;