shithub: gemnine

Download patch

ref: afd1e85aa0dd7c71d7cd7f2cdaf18abd4e6513ae
parent: ae93b05f1d2454bf04ddcaa32f59859bebe49526
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Sun May 17 20:01:39 EDT 2020

show previous url after each reponse

--- a/main.c
+++ b/main.c
@@ -214,7 +214,7 @@
 main(int argc, char **argv)
 {
 	Response *r;
-	char *s, *t, *u, *url;
+	char *s, *t, *u, *url, *prevurl;
 	int len, wait, pl, fd;
 	Plumbmsg *m;
 	Biobuf out;
@@ -235,6 +235,7 @@
 	quotefmtinstall();
 	Binit(&out, 1, OWRITE);
 	pl = -1;
+	prevurl = nil;
 
 nexturl:
 	url = nil;
@@ -305,9 +306,13 @@
 		if(!wait)
 			exits("failed");
 	}
+	if(prevurl != nil){
+		Bprint(&out, "\nPrevious: %s\n", prevurl);
+		free(prevurl);
+	}
 
 	Bflush(&out);
-	free(url);
+	prevurl = url;
 	if(wait)
 		goto nexturl;