Recently Written · git

sacc

Mirror of git://bitreich.org/sacc, the sacc gopher client from bitreich.org.

git clone https://github.com/equwal/sacc

Log | Files | Refs


commit 250ea3842c49c0f1b8224a607e5a4d7fd5dd7ae3
Quentin Rameau <quinq@fifth.space>
2019-10-29 00:24:07 +0100

Fix initial URI search string parsing

Thanks to Hiltjo for spotting this!

 sacc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sacc.c b/sacc.c
index 33b2678..c4092e5 100644
--- a/sacc.c
+++ b/sacc.c
@@ -922,12 +922,11 @@ moldentry(char *url)
 	entry->type = gopherpath[0];
 	entry->username = entry->selector = ++gopherpath;
 	if (entry->type == '7') {
-		p = gopherpath;
-		if (p = strstr(p, "%09")) {
+		if (p = strstr(gopherpath, "%09")) {
 			memmove(p+1, p+3, strlen(p+3)+1);
 			*p = '\t';
 		}
-		if (p = strchr(p, '\t')) {
+		if (p || (p = strchr(gopherpath, '\t'))) {
 			asprintf(&entry->tag, "%s", gopherpath);
 			*p = '\0';
 		}