=================================================================== RCS file: /cvs/texi2mdoc/main.c,v retrieving revision 1.47 retrieving revision 1.51 diff -u -p -r1.47 -r1.51 --- texi2mdoc/main.c 2015/02/25 15:04:13 1.47 +++ texi2mdoc/main.c 2015/02/27 19:28:55 1.51 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.47 2015/02/25 15:04:13 kristaps Exp $ */ +/* $Id: main.c,v 1.51 2015/02/27 19:28:55 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 */ @@ -432,7 +432,8 @@ dodefn(struct texi *p, enum texicmd cmd, size_t *pos) break; } - texiputchars(p, ":\n"); + texiputchar(p, ':'); + texiputchar(p, '\n'); switch (cmd) { case (TEXICMD_DEFMAC): @@ -727,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); @@ -989,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); @@ -1311,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); } @@ -1607,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");