From abbbac581fb9e15b6b9fc33f87b1238d9cd1980c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 29 Sep 2014 19:03:46 -0700 Subject: Fix broken one-character font names. --- man2html/man2html.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/man2html/man2html.c b/man2html/man2html.c index b4c6cb6..e454744 100644 --- a/man2html/man2html.c +++ b/man2html/man2html.c @@ -135,6 +135,11 @@ static int str_to_code(char *str, char *delim) return code; } +static int scrub_space(int code) +{ + return (code % 256== ' ') ? code / 256 : code; +} + static char outbuffer[1024]; static int obp=0; static int no_newline_output=0; /* boolean, set by \c */ @@ -477,12 +482,6 @@ change_to_font(int nr) case '1': case '2': case '3': case '4': case '5': nr -= '1'; break; - case V(' ', '0'): - nr++; - case V('1',' '): case V('2',' '): case V('3',' '): - case V('4',' '): case V('5',' '): - nr = nr / 256 - '1'; - break; case V('C','W'): case V('C','R'): nr=3; break; case V('C','O'): case V('C','I'): nr=4; break; case 'L': nr=3; break; @@ -639,7 +638,7 @@ scan_escape(char *c) { skip_escape = se; } else if (*c == '[' || *c == '(') { c++; - i = str_to_code(c, ")]"); + i = scrub_space(str_to_code(c, ")]")); c += strcspn(c, ")]"); } else { i=*c; @@ -1827,7 +1826,7 @@ scan_request(char *c) { out_html(change_to_font(*c)); c++; } else { - int nr = str_to_code(c, 0); + int nr = scrub_space(str_to_code(c, 0)); out_html(change_to_font(nr)); c += strcspn(c, " \t\n"); } -- cgit v1.2.3