=================================================================== RCS file: /cvs/texi2mdoc/util.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -p -r1.22 -r1.23 --- texi2mdoc/util.c 2015/03/01 16:57:39 1.22 +++ texi2mdoc/util.c 2015/03/02 18:12:53 1.23 @@ -1,4 +1,4 @@ -/* $Id: util.c,v 1.22 2015/03/01 16:57:39 kristaps Exp $ */ +/* $Id: util.c,v 1.23 2015/03/02 18:12:53 kristaps Exp $ */ /* * Copyright (c) 2015 Kristaps Dzonsons * @@ -184,7 +184,10 @@ texiputchar(struct texi *p, char c) if ('\'' == c && 0 == p->outcol) fputs("\\&", p->outfile); - fputc(c, p->outfile); + if (p->uppercase) + fputc(toupper((unsigned int)c), p->outfile); + else + fputc(c, p->outfile); if ('\\' == c) fputc('e', p->outfile); p->seenvs = 0; @@ -210,7 +213,12 @@ texiputchars(struct texi *p, const char *s) fputs("\\&", p->outfile); if ('\'' == *s && 0 == p->outcol) fputs("\\&", p->outfile); - p->outcol += fputs(s, p->outfile); + if (p->uppercase) + for ( ; '\0' != *s; s++) + p->outcol += fputc(toupper + ((unsigned int)*s), p->outfile); + else + p->outcol += fputs(s, p->outfile); p->seenvs = 0; } @@ -616,7 +624,7 @@ texicmd(const struct texi *p, size_t pos, size_t *end, return(TEXICMD__MAX); /* Alphabetic commands are special. */ - if ( ! isalpha((unsigned char)BUF(p)[pos])) { + if ( ! isalpha((unsigned int)BUF(p)[pos])) { if ((*end = pos + 1) == BUFSZ(p)) return(TEXICMD__MAX); for (i = 0; i < TEXICMD__MAX; i++) {