From 13183ec95d3ae2745c4f24de6cc3de68996797df Mon Sep 17 00:00:00 2001 From: wlemb Date: Tue, 25 Nov 2003 21:41:33 +0000 Subject: * src/roff/troff/env.cpp (hyphen_trie::read_patterns_file): Fix loop if processing hyphenation patterns in traditional mode. Improve error messages. * src/roff/troff/node.cpp (troff_output_file::put_char_width, troff_output_file::put_char): Fix type of local variable `c'. --- ChangeLog | 11 +++++++++++ src/roff/troff/env.cpp | 19 +++++++++++++++---- src/roff/troff/node.cpp | 4 ++-- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6fdc4e63..749a8b35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-11-24 Werner LEMBERG + + * src/roff/troff/env.cpp (hyphen_trie::read_patterns_file): Fix loop + if processing hyphenation patterns in traditional mode. + Improve error messages. + +2003-11-20 Werner LEMBERG + + * src/roff/troff/node.cpp (troff_output_file::put_char_width, + troff_output_file::put_char): Fix type of local variable `c'. + 2003-11-19 Werner LEMBERG * src/roff/groff/pipeline.c (P): Removed. Updated all function diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp index 264b441b..3c7ff02e 100644 --- a/src/roff/troff/env.cpp +++ b/src/roff/troff/env.cpp @@ -3661,7 +3661,8 @@ void hyphen_trie::read_patterns_file(const char *name, int append, c = hpf_getc(fp); if (c == '{') { if (have_patterns || have_hyphenation) - error("`{' not allowed inside of \\patterns or \\hyphenation"); + error("\\patterns not allowed inside of %1 group", + have_patterns ? "\\patterns" : "\\hyphenation"); else { have_patterns = 1; have_keyword = 1; @@ -3675,7 +3676,8 @@ void hyphen_trie::read_patterns_file(const char *name, int append, c = hpf_getc(fp); if (c == '{') { if (have_patterns || have_hyphenation) - error("`{' not allowed inside of \\patterns or \\hyphenation"); + error("\\hyphenation not allowed inside of %1 group", + have_patterns ? "\\patterns" : "\\hyphenation"); else { have_hyphenation = 1; have_keyword = 1; @@ -3703,8 +3705,17 @@ void hyphen_trie::read_patterns_file(const char *name, int append, } c = hpf_getc(fp); } - else if (c == '{') // skipped if not starting \patterns - c = hpf_getc(fp); // or \hyphenation + else if (c == '{') { + if (have_patterns || have_hyphenation) + error("`{' not allowed within %1 group", + have_patterns ? "\\patterns" : "\\hyphenation"); + c = hpf_getc(fp); // skipped if not starting \patterns + // or \hyphenation + } + } + else { + if (c == '{' || c == '}') + c = hpf_getc(fp); } if (i > 0) { if (have_patterns || final_pattern || traditional) { diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp index 320358fe..20be65d4 100644 --- a/src/roff/troff/node.cpp +++ b/src/roff/troff/node.cpp @@ -987,7 +987,7 @@ void troff_output_file::put_char_width(charinfo *ci, tfont *tf, return; } set_font(tf); - char c = ci->get_ascii_code(); + unsigned char c = ci->get_ascii_code(); if (c == '\0') { glyph_color(gcol); fill_color(fcol); @@ -1065,7 +1065,7 @@ void troff_output_file::put_char(charinfo *ci, tfont *tf, if (!is_on()) return; set_font(tf); - char c = ci->get_ascii_code(); + unsigned char c = ci->get_ascii_code(); if (c == '\0') { glyph_color(gcol); fill_color(fcol); -- cgit v1.2.1