summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwlemb <wlemb>2003-11-25 21:41:33 +0000
committerwlemb <wlemb>2003-11-25 21:41:33 +0000
commit13183ec95d3ae2745c4f24de6cc3de68996797df (patch)
treefcac057c568aebc5aaa43788203403a9abefe6c7
parent08a6464316954c18cf07ced3f3fb58c7c01764df (diff)
downloadgroff-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'.
-rw-r--r--ChangeLog11
-rw-r--r--src/roff/troff/env.cpp19
-rw-r--r--src/roff/troff/node.cpp4
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 <wl@gnu.org>
+
+ * 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 <wl@gnu.org>
+
+ * 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 <wl@gnu.org>
* 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);