Skip to content

Commit aaaa994

Browse files
committed
omit trailing tags from dupbase as well
1 parent 172a785 commit aaaa994

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

sortdb.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <wchar.h>
3030
#include <wctype.h>
3131

32-
__RCSID("$MirOS: wtf/sortdb.c,v 1.26 2023/02/28 20:01:19 tg Exp $");
32+
__RCSID("$MirOS: wtf/sortdb.c,v 1.27 2023/12/04 22:39:21 tg Exp $");
3333

3434
#define MAXCASECONV 512
3535
struct cconv {
@@ -541,6 +541,20 @@ main(int argc, char *argv[])
541541
cwp = pwp;
542542
goto do_dupbase;
543543
}
544+
/* and trailing tags */
545+
while (cwp > twp && *cwp == L']') {
546+
wchar_t *pwp = wcsrchr(twp, '[');
547+
if (pwp == NULL)
548+
break;
549+
if (pwp == twp) {
550+
fprintf(stderr, "I: #%zu empty <%s>\n",
551+
nlines + 1, lines[nlines].literal);
552+
break;
553+
}
554+
cwp = pwp;
555+
goto do_dupbase;
556+
}
557+
544558
--cp;
545559
if (asp) {
546560
/* length difference? */

0 commit comments

Comments
 (0)