commit f5c4455a5b14c5824fb7f9761b94898d973aa820
Author: h <[email protected]>
Date:   Sun Nov 14 23:03:16 2021 +0000

    [surf][patch][history] fix error in 2.1 patch

diff --git a/surf.suckless.org/patches/history/surf-2.1-history.diff 
b/surf.suckless.org/patches/history/surf-2.1-history.diff
index 0fa58153..453750d6 100644
--- a/surf.suckless.org/patches/history/surf-2.1-history.diff
+++ b/surf.suckless.org/patches/history/surf-2.1-history.diff
@@ -12,7 +12,7 @@ index b6ae4fc..74b1968 100644
  /* Webkit default features */
  /* Highest priority value will be used.
 diff --git a/surf.c b/surf.c
-index e709f35..9c9fc90 100644
+index e709f35..d7c2166 100644
 --- a/surf.c
 +++ b/surf.c
 @@ -347,9 +347,10 @@ setup(void)
@@ -33,11 +33,11 @@ index e709f35..9c9fc90 100644
        } else {
                webkit_web_view_load_uri(c->view, url);
                updatetitle(c);
-+              updatehistory(c);
++              updatehistory(url);
        }
  
        g_free(url);
-@@ -659,6 +661,22 @@ updatetitle(Client *c)
+@@ -659,6 +661,20 @@ updatetitle(Client *c)
        }
  }
  
@@ -47,20 +47,18 @@ index e709f35..9c9fc90 100644
 +      FILE *f;
 +      f = fopen(historyfile, "a+");
 +
-+      char b[20];
++      char timestamp[20];
 +      time_t now = time (0);
-+      strftime (b, 20, "%Y-%m-%dT%H:%M:%S", localtime (&now));
-+      fputs(b, f);
++      strftime (timestamp, 20, "%Y-%m-%dT%H:%M:%S", localtime (&now));
 +
-+      fprintf(f, " %s
", url);
++      fprintf(f, "%s %s
", timestamp, url);
 +      fclose(f);
-+
 +}
 +
  void
  gettogglestats(Client *c)
  {
-@@ -1085,6 +1103,7 @@ cleanup(void)
+@@ -1085,6 +1101,7 @@ cleanup(void)
        close(spair[0]);
        close(spair[1]);
        g_free(cookiefile);


Reply via email to