surf-0.3-history.diff - sites - public wiki contents of suckless.org
 (HTM) git clone git://git.suckless.org/sites
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
       surf-0.3-history.diff (1475B)
       ---
            1 diff -up surf-0.3/config.def.h surf-0.3-modified/config.def.h
            2 --- surf-0.3/config.def.h        2009-10-30 08:41:02.000000000 -0400
            3 +++ surf-0.3-modified/config.def.h        2009-12-03 16:09:51.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 char *dldir          = ".surf/dl";
           10  static time_t sessiontime   = 3600;
           11  
           12 diff -up surf-0.3/surf.c surf-0.3-modified/surf.c
           13 --- surf-0.3/surf.c        2009-10-30 08:41:02.000000000 -0400
           14 +++ surf-0.3-modified/surf.c        2009-12-03 16:08:20.000000000 -0500
           15 @@ -166,6 +166,7 @@ cleanup(void) {
           16          while(clients)
           17                  destroyclient(clients);
           18          g_free(cookiefile);
           19 +        g_free(historyfile);
           20          g_free(dldir);
           21          g_free(scriptfile);
           22          g_free(stylefile);
           23 @@ -439,6 +440,12 @@ loaduri(Client *c, const Arg *arg) {
           24          u = g_strrstr(uri, "://") ? g_strdup(uri)
           25                  : g_strdup_printf("http://%s", uri);
           26          webkit_web_view_load_uri(c->view, u);
           27 +
           28 +        FILE *f;
           29 +        f = fopen(historyfile, "a+");
           30 +        fprintf(f, "%s\n", u);
           31 +        fclose(f);
           32 +
           33          c->progress = 0;
           34          c->title = copystr(&c->title, u);
           35          g_free(u);
           36 @@ -695,6 +702,7 @@ setup(void) {
           37  
           38          /* create dirs and files */
           39          cookiefile = buildpath(cookiefile);
           40 +        historyfile = buildpath(historyfile);
           41          dldir = buildpath(dldir);
           42          scriptfile = buildpath(scriptfile);
           43          stylefile = buildpath(stylefile);