shithub: libtags

Download patch

ref: 7996f8dba6494fdafc13564924fae575419c7c14
parent: bde3359eb05ab492444a9ce87c05d855524c33b8
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Thu Apr 29 17:34:41 EDT 2021

modules: ignore empty titles

--- a/it.c
+++ b/it.c
@@ -8,8 +8,8 @@
 	if(ctx->read(ctx, d, 4+26) != 4+26 || memcmp(d, "IMPM", 4) != 0)
 		return -1;
 	d[4+26] = 0;
-	cp437toutf8(o, sizeof(o), d+4, 26);
-	txtcb(ctx, Ttitle, "", o);
+	if(cp437toutf8(o, sizeof(o), d+4, 26) > 0)
+		txtcb(ctx, Ttitle, "", o);
 
 	return 0;
 }
--- a/mod.c
+++ b/mod.c
@@ -41,8 +41,8 @@
 		return -1;
 	if(ctx->read(ctx, d, 20) != 20)
 		return -1;
-	cp437toutf8(o, sizeof(o), d, 20);
-	txtcb(ctx, Ttitle, "", o);
+	if(cp437toutf8(o, sizeof(o), d, 20) > 0)
+		txtcb(ctx, Ttitle, "", o);
 
 	return 0;
 }
--- a/s3m.c
+++ b/s3m.c
@@ -10,8 +10,8 @@
 	d[28] = 0;
 	for(s = d+27; s != d-1 && (*s == ' ' || *s == 0); s--);
 	s[1] = 0;
-	cp437toutf8(o, sizeof(o), d, s+1-d);
-	txtcb(ctx, Ttitle, "", o);
+	if(cp437toutf8(o, sizeof(o), d, s+1-d) > 0)
+		txtcb(ctx, Ttitle, "", o);
 
 	return 0;
 }
--- a/xm.c
+++ b/xm.c
@@ -9,8 +9,8 @@
 		return -1;
 	d[17+20] = 0;
 	for(s = d+17; *s == ' '; s++);
-	cp437toutf8(o, sizeof(o), d+17, 20);
-	txtcb(ctx, Ttitle, "", o);
+	if(cp437toutf8(o, sizeof(o), d+17, 20) > 0)
+		txtcb(ctx, Ttitle, "", o);
 
 	return 0;
 }