shithub: gemnine

Download patch

ref: 11e93db76eefebd94f03bace14526c5218a3cfc6
parent: a194837a08fbac1792c9db77f5298a9a999ef6fb
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Jan 19 10:30:16 EST 2021

do not print url description if it is the same as the url itself

--- a/main.c	Wed Dec  9 11:33:46 2020
+++ b/main.c	Tue Jan 19 10:30:16 2021
@@ -46,7 +46,7 @@
 main(int argc, char **argv)
 {
 	Response *r;
-	char *s, *t, *u;
+	char *s, *t, *u, *tmp;
 	Url *url, *x;
 	int len, wait, pl, fd;
 	Plumbmsg *m;
@@ -152,7 +152,11 @@
 						else
 							t = "";
 						x = urlparse(r->url, u);
-						Bprint(&out, "→ %U %s\n", x, t);
+						if((tmp = smprint("%U", x)) != nil && strcmp(tmp, t) == 0)
+							Bprint(&out, "→ %s\n", tmp);
+						else
+							Bprint(&out, "→ %s %s\n", tmp, t);
+						free(tmp);
 						freeurl(x);
 					}else{
 						Bprint(&out, "%s\n", s);