Commit:11e93db76eefebd94f03bace14526c5218a3cfc6 (browse)
Parent:a194837a08fbac1792c9db77f5298a9a999ef6fb
Author:Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
Date:Tue Jan 19 16:30:16 CET 2021
Message:
do not print url description if it is the same as the url itself

main.c => main.c
@@ -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);