=================================================================== RCS file: /cvs/mandoc/Attic/mdocterm.c,v retrieving revision 1.30 retrieving revision 1.33 diff -u -p -r1.30 -r1.33 --- mandoc/Attic/mdocterm.c 2009/03/04 14:04:02 1.30 +++ mandoc/Attic/mdocterm.c 2009/03/05 13:12:12 1.33 @@ -1,4 +1,4 @@ -/* $Id: mdocterm.c,v 1.30 2009/03/04 14:04:02 kristaps Exp $ */ +/* $Id: mdocterm.c,v 1.33 2009/03/05 13:12:12 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -78,6 +78,8 @@ static struct termenc termenc1[] = { static struct termenc termenc2[] = { { "rB", TERMSYM_RBRACK }, { "lB", TERMSYM_LBRACK }, + { "ra", TERMSYM_RANGLE }, + { "la", TERMSYM_LANGLE }, { "Lq", TERMSYM_LDQUOTE }, { "lq", TERMSYM_LDQUOTE }, { "Rq", TERMSYM_RDQUOTE }, @@ -99,7 +101,7 @@ static struct termenc termenc2[] = { { "Le", TERMSYM_LE }, { "<=", TERMSYM_LE }, { "Ge", TERMSYM_GE }, - { "=>", TERMSYM_GE }, + { ">=", TERMSYM_GE }, { "==", TERMSYM_EQ }, { "Ne", TERMSYM_NEQ }, { "!=", TERMSYM_NEQ }, @@ -161,6 +163,8 @@ static struct termsym termsym_ansi[] = { { " ", 1 }, /* TERMSYM_SPACE */ { ".", 1 }, /* TERMSYM_PERIOD */ { "", 0 }, /* TERMSYM_BREAK */ + { "<", 1 }, /* TERMSYM_LANGLE */ + { ">", 1 }, /* TERMSYM_RANGLE */ }; static const char ansi_clear[] = { 27, '[', '0', 'm' }; @@ -283,7 +287,7 @@ flushln(struct termp *p) /* LINTED */ for (j = i, vsz = 0; j < p->col; j++) { - if (isspace((int)p->buf[j])) + if (isspace((u_char)p->buf[j])) break; else if (27 == p->buf[j]) { assert(j + 4 <= p->col); @@ -330,7 +334,7 @@ flushln(struct termp *p) */ for ( ; i < p->col; i++) { - if (isspace((int)p->buf[i])) + if (isspace((u_char)p->buf[i])) break; putchar(p->buf[i]); } @@ -347,9 +351,11 @@ flushln(struct termp *p) */ if ((TERMP_NOBREAK & p->flags) && vis >= maxvis) { - putchar('\n'); - for (i = 0; i < p->rmargin; i++) - putchar(' '); + if ( ! (TERMP_NONOBREAK & p->flags)) { + putchar('\n'); + for (i = 0; i < p->rmargin; i++) + putchar(' '); + } p->col = 0; return; } @@ -359,10 +365,11 @@ flushln(struct termp *p) * pad to the right margin and stay off. */ - if (p->flags & TERMP_NOBREAK) - for ( ; vis < maxvis; vis++) - putchar(' '); - else + if (p->flags & TERMP_NOBREAK) { + if ( ! (TERMP_NONOBREAK & p->flags)) + for ( ; vis < maxvis; vis++) + putchar(' '); + } else putchar('\n'); p->col = 0; @@ -430,13 +437,13 @@ word(struct termp *p, const char *word) /* LINTED */ for (j = i = 0; i < len; i++) { - if ( ! isspace((int)word[i])) { + if ( ! isspace((u_char)word[i])) { j++; continue; } /* Escaped spaces don't delimit... */ - if (i > 0 && isspace((int)word[i]) && + if (i > 0 && isspace((u_char)word[i]) && '\\' == word[i - 1]) { j++; continue; @@ -642,7 +649,7 @@ header(struct termp *p, const struct mdoc_meta *meta) meta->title, pp ? pp : ""); for (bufp = title; *bufp; bufp++) - *bufp = toupper(*bufp); + *bufp = toupper((u_char)*bufp); p->offset = 0; p->rmargin = (p->maxrmargin - strlen(buf)) / 2;