libtags: modules: ignore empty title

This commit is contained in:
Sigrid 2021-04-29 23:35:52 +02:00
parent 7cff84371d
commit e5535fad32
4 changed files with 8 additions and 8 deletions

View file

@ -8,7 +8,7 @@ tagit(Tagctx *ctx)
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);
if(cp437toutf8(o, sizeof(o), d+4, 26) > 0)
txtcb(ctx, Ttitle, "", o);
return 0;

View file

@ -41,7 +41,7 @@ tagmod(Tagctx *ctx)
return -1;
if(ctx->read(ctx, d, 20) != 20)
return -1;
cp437toutf8(o, sizeof(o), d, 20);
if(cp437toutf8(o, sizeof(o), d, 20) > 0)
txtcb(ctx, Ttitle, "", o);
return 0;

View file

@ -10,7 +10,7 @@ tags3m(Tagctx *ctx)
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);
if(cp437toutf8(o, sizeof(o), d, s+1-d) > 0)
txtcb(ctx, Ttitle, "", o);
return 0;

View file

@ -9,7 +9,7 @@ tagxm(Tagctx *ctx)
return -1;
d[17+20] = 0;
for(s = d+17; *s == ' '; s++);
cp437toutf8(o, sizeof(o), d+17, 20);
if(cp437toutf8(o, sizeof(o), d+17, 20) > 0)
txtcb(ctx, Ttitle, "", o);
return 0;