commit f5c4455a5b14c5824fb7f9761b94898d973aa820
parent dc2e7b6542d0a8af6f2b836cf914326029117235
Author: h <h@abbcd.net>
Date: Sun, 14 Nov 2021 23:03:16 +0000
[surf][patch][history] fix error in 2.1 patch
Diffstat:
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git 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\n", url);
++ fprintf(f, "%s %s\n", 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);