surf-0.4.1-history.diff (1346B)
1 diff -up surf-0.4.1/config.def.h surf-0.4.1-history/config.def.h 2 --- surf-0.4.1/config.def.h 2010-06-08 03:06:41.000000000 -0400 3 +++ surf-0.4.1-history/config.def.h 2010-12-25 20:00:08.000000000 -0500 4 @@ -5,6 +5,7 @@ static char *progress_trust = "#00FF00"; 5 static char *stylefile = ".surf/style.css"; 6 static char *scriptfile = ".surf/script.js"; 7 static char *cookiefile = ".surf/cookies.txt"; 8 +static char *historyfile = ".surf/history.txt"; 9 static time_t sessiontime = 3600; 10 #define NOBACKGROUND 0 11 12 diff -up surf-0.4.1/surf.c surf-0.4.1-history/surf.c 13 --- surf-0.4.1/surf.c 2010-06-08 03:06:42.000000000 -0400 14 +++ surf-0.4.1-history/surf.c 2010-12-25 19:50:51.000000000 -0500 15 @@ -140,6 +140,7 @@ cleanup(void) { 16 while(clients) 17 destroyclient(clients); 18 g_free(cookiefile); 19 + g_free(historyfile); 20 g_free(scriptfile); 21 g_free(stylefile); 22 } 23 @@ -396,6 +397,10 @@ loaduri(Client *c, const Arg *arg) { 24 } 25 else { 26 webkit_web_view_load_uri(c->view, u); 27 + FILE *f; 28 + f = fopen(historyfile, "a+"); 29 + fprintf(f, u); 30 + fclose(f); 31 c->progress = 0; 32 c->title = copystr(&c->title, u); 33 g_free(u); 34 @@ -689,6 +694,7 @@ setup(void) { 35 36 /* dirs and files */ 37 cookiefile = buildpath(cookiefile); 38 + historyfile = buildpath(historyfile); 39 scriptfile = buildpath(scriptfile); 40 stylefile = buildpath(stylefile); 41