diff options
author | wlemb <wlemb> | 2003-11-25 21:41:33 +0000 |
---|---|---|
committer | wlemb <wlemb> | 2003-11-25 21:41:33 +0000 |
commit | 13183ec95d3ae2745c4f24de6cc3de68996797df (patch) | |
tree | fcac057c568aebc5aaa43788203403a9abefe6c7 /src/roff | |
parent | 08a6464316954c18cf07ced3f3fb58c7c01764df (diff) | |
download | groff-13183ec95d3ae2745c4f24de6cc3de68996797df.tar.gz |
* 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'.
Diffstat (limited to 'src/roff')
-rw-r--r-- | src/roff/troff/env.cpp | 19 | ||||
-rw-r--r-- | src/roff/troff/node.cpp | 4 |
2 files changed, 17 insertions, 6 deletions
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); |