=================================================================== RCS file: /cvs/texi2mdoc/main.c,v retrieving revision 1.48 retrieving revision 1.52 diff -u -p -r1.48 -r1.52 --- texi2mdoc/main.c 2015/02/25 15:15:18 1.48 +++ texi2mdoc/main.c 2015/02/28 00:03:20 1.52 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.48 2015/02/25 15:15:18 kristaps Exp $ */ +/* $Id: main.c,v 1.52 2015/02/28 00:03:20 kristaps Exp $ */ /* * Copyright (c) 2015 Kristaps Dzonsons * @@ -296,8 +296,8 @@ static const struct texitok __texitoks[TEXICMD__MAX] = { dosubsubsection, "subsubsection", 13 }, /* TEXICMD_SUBSUBSECTION */ { doignline, "subtitle", 8 }, /* TEXICMD_SUBTITLE */ { doignline, "summarycontents", 15 }, /* TEXICMD_SUMMARYCONTENTS */ - { doignline, "synindex", 8 }, /* TEXICMD_SYNINDEX */ - { doignline, "syncodeindex", 12 }, /* TEXICMD_SYNCODEINDEX */ + { dodefindex, "synindex", 8 }, /* TEXICMD_SYNINDEX */ + { dodefindex, "syncodeindex", 12 }, /* TEXICMD_SYNCODEINDEX */ { doinline, "t", 1 }, /* TEXICMD_T */ { dotab, "tab", 3 }, /* TEXICMD_TAB */ { dosymbol, "\t", 1 }, /* TEXICMD_TABSYM */ @@ -614,8 +614,8 @@ doignblock(struct texi *p, enum texicmd cmd, size_t *p * Thus, we keep track of scopes for matching "end" blocks. */ while (stack > 0 && *pos < BUFSZ(p)) { - if (stack > 10) - abort(); + if (stack > 64) + texierr(p, "run-away nested stack?"); endt = memmem(&BUF(p)[*pos], BUFSZ(p) - *pos, end, esz); startt = memmem(&BUF(p)[*pos], BUFSZ(p) - *pos, start, ssz); if (NULL == endt) { @@ -728,7 +728,7 @@ doverb(struct texi *p, enum texicmd cmd, size_t *pos) break; advance(p, pos); } - if (*pos == BUFSZ(p) - 1) + if (*pos >= BUFSZ(p) - 1) return; texiputbuf(p, start, *pos); @@ -990,7 +990,7 @@ doaccent(struct texi *p, enum texicmd cmd, size_t *pos if ('{' == BUF(p)[*pos]) { brace = 1; advance(p, pos); - } else if (isalpha(texitoks[cmd].tok[0])) + } else if (isalpha((unsigned char)texitoks[cmd].tok[0])) while (*pos < BUFSZ(p) && isws(BUF(p)[*pos])) advance(p, pos); @@ -1312,7 +1312,7 @@ dosymbol(struct texi *p, enum texicmd cmd, size_t *pos } /* Alphabetic commands have braces we ignore. */ - if (isalpha(texitoks[cmd].tok[0])) + if (isalpha((unsigned char)texitoks[cmd].tok[0])) doignbracket(p, cmd, pos); } @@ -1608,7 +1608,7 @@ dotop(struct texi *p, enum texicmd cmd, size_t *pos) teximacroclose(p); teximacroopen(p, "Dt"); for (cp = p->title; '\0' != *cp; cp++) - texiputchar(p, toupper(*cp)); + texiputchar(p, toupper((unsigned int)*cp)); texiputchars(p, " 7"); teximacroclose(p); teximacro(p, "Os");