From 6603e09fab4607d6f7f62af08c5ef3304513b368 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 1 Sep 2010 01:28:22 +0000 Subject: [PATCH] Added a helper function to handle history --- src/common/history.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/common/history.c b/src/common/history.c index 8c4dc8f..7df0c53 100644 --- a/src/common/history.c +++ b/src/common/history.c @@ -98,3 +98,18 @@ static gchar const * _history_get_location(GList * history) return NULL; return ghh->url; } + + +/* useful */ +static GList * _history_append(History * history, GList * list) +{ + GList * l; + + if(list == NULL) + return g_list_append(list, history); + for(l = list->next; l != NULL; l = g_list_delete_link(l, l)) + _history_delete(l->data); + list->next = NULL; + l = g_list_append(list, history); + return l->next; +}