=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/term.c,v retrieving revision 1.44 retrieving revision 1.45 diff -c -r1.44 -r1.45 *** src/usr.bin/mandoc/term.c 2010/07/13 01:09:13 1.44 --- src/usr.bin/mandoc/term.c 2010/07/25 18:05:54 1.45 *************** *** 1,4 **** ! /* $Id: term.c,v 1.44 2010/07/13 01:09:13 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze --- 1,4 ---- ! /* $Id: term.c,v 1.45 2010/07/25 18:05:54 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze *************** *** 30,36 **** #include "term.h" #include "main.h" ! static void spec(struct termp *, const char *, size_t); static void res(struct termp *, const char *, size_t); static void buffera(struct termp *, const char *, size_t); static void bufferc(struct termp *, char); --- 30,37 ---- #include "term.h" #include "main.h" ! static void spec(struct termp *, enum roffdeco, ! const char *, size_t); static void res(struct termp *, const char *, size_t); static void buffera(struct termp *, const char *, size_t); static void bufferc(struct termp *, char); *************** *** 356,369 **** static void ! spec(struct termp *p, const char *word, size_t len) { const char *rhs; size_t sz; ! rhs = chars_a2ascii(p->symtab, word, len, &sz); if (rhs) encode(p, rhs, sz); } --- 357,372 ---- static void ! spec(struct termp *p, enum roffdeco d, const char *word, size_t len) { const char *rhs; size_t sz; ! rhs = chars_spec2str(p->symtab, word, len, &sz); if (rhs) encode(p, rhs, sz); + else if (DECO_SSPECIAL == d) + encode(p, word, len); } *************** *** 373,379 **** const char *rhs; size_t sz; ! rhs = chars_a2res(p->symtab, word, len, &sz); if (rhs) encode(p, rhs, sz); } --- 376,382 ---- const char *rhs; size_t sz; ! rhs = chars_res2str(p->symtab, word, len, &sz); if (rhs) encode(p, rhs, sz); } *************** *** 499,512 **** p->flags &= ~TERMP_SENTENCE; - /* FIXME: use strcspn. */ - while (*word) { ! if ('\\' != *word) { ! encode(p, word, 1); ! word++; continue; - } seq = ++word; sz = a2roffdeco(&deco, &seq, &ssz); --- 502,514 ---- p->flags &= ~TERMP_SENTENCE; while (*word) { ! if ((ssz = strcspn(word, "\\")) > 0) ! encode(p, word, ssz); ! ! word += ssz; ! if ('\\' != *word) continue; seq = ++word; sz = a2roffdeco(&deco, &seq, &ssz); *************** *** 516,522 **** res(p, seq, ssz); break; case (DECO_SPECIAL): ! spec(p, seq, ssz); break; case (DECO_BOLD): term_fontrepl(p, TERMFONT_BOLD); --- 518,526 ---- res(p, seq, ssz); break; case (DECO_SPECIAL): ! /* FALLTHROUGH */ ! case (DECO_SSPECIAL): ! spec(p, deco, seq, ssz); break; case (DECO_BOLD): term_fontrepl(p, TERMFONT_BOLD); *************** *** 543,549 **** * Note that we don't process the pipe: the parser sees it as * punctuation, but we don't in terms of typography. */ ! if (sv[0] && 0 == sv[1]) switch (sv[0]) { case('('): /* FALLTHROUGH */ --- 547,553 ---- * Note that we don't process the pipe: the parser sees it as * punctuation, but we don't in terms of typography. */ ! if (sv[0] && '\0' == sv[1]) switch (sv[0]) { case('('): /* FALLTHROUGH */