diff options
author | wlemb <wlemb> | 2002-05-15 01:11:18 +0000 |
---|---|---|
committer | wlemb <wlemb> | 2002-05-15 01:11:18 +0000 |
commit | 8f90d499189ca6f2ef8615ecc8104c15ecd1aa08 (patch) | |
tree | a431c995e240efee76f8f8fb8670b635bc43b692 | |
parent | 84122cb3601f293232c153b3d9c057b96fc76a21 (diff) | |
download | groff-8f90d499189ca6f2ef8615ecc8104c15ecd1aa08.tar.gz |
* src/roff/troff/env.cc(hyphen_trie::hpf_getc): Accept ^^x (char
code of x in range 0-127) also.
* doc/groff.texinfo, man/groff_diff.man: Updated.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | doc/groff.texinfo | 5 | ||||
-rw-r--r-- | man/groff_diff.man | 7 | ||||
-rw-r--r-- | src/roff/troff/env.cc | 43 |
4 files changed, 40 insertions, 21 deletions
@@ -1,3 +1,9 @@ +2002-05-15 Werner LEMBERG <wl@gnu.org> + + * src/roff/troff/env.cc(hyphen_trie::hpf_getc): Accept ^^x (char + code of x in range 0-127) also. + * doc/groff.texinfo, man/groff_diff.man: Updated. + 2002-05-14 Werner LEMBERG <wl@gnu.org> * src/devices/grops/grops.man: Clarify handling of `download' file. diff --git a/doc/groff.texinfo b/doc/groff.texinfo index e2b4fbf0..ab425733 100644 --- a/doc/groff.texinfo +++ b/doc/groff.texinfo @@ -5968,8 +5968,9 @@ even if preceded by a backslash. No support for `digraphs' like @code{\$}. @item -The only multi-character construction recognized is @code{^^@var{xx}} -(@var{x} is 0-9 or a-f); other use of @code{^} causes an error. +@code{^^@var{xx}} (@var{x} is 0-9 or a-f) and @code{^^@var{x}} (character +code of @var{x} in the range 0-127) are recognized; other use of @code{^} +causes an error. @item No macro expansion. diff --git a/man/groff_diff.man b/man/groff_diff.man index c1e22e2f..8944c260 100644 --- a/man/groff_diff.man +++ b/man/groff_diff.man @@ -1464,10 +1464,13 @@ No support for `digraphs' like .BR \[rs]$ . . .IP \[bu] -The only multi-character construction recognized is .BI ^^ xx .RI ( x -is 0-9 or a-f); other use of +is 0-9 or a-f) and +.BI ^^ x +(character code of\~\c +.I x +in the range 0-127) are recognized; other use of .B ^ causes an error. . diff --git a/src/roff/troff/env.cc b/src/roff/troff/env.cc index 2d677745..57630c92 100644 --- a/src/roff/troff/env.cc +++ b/src/roff/troff/env.cc @@ -3477,9 +3477,8 @@ void hyphen_trie::do_delete(void *v) . No support for digraphs and like `\$'. - . The only multi-character construction recognized is `^^xx' (`x' is - 0-9 or a-f), handled by `hpf_getc'; other use of `^' causes an - error. + . `^^xx' (`x' is 0-9 or a-f), and `^^x' (character code of `x' in the + range 0-127) are recognized; other use of `^' causes an error. . No macro expansion. @@ -3502,6 +3501,7 @@ void hyphen_trie::do_delete(void *v) int hyphen_trie::hpf_getc(FILE *f) { int c = getc(f); + int c1; int cc = 0; if (c != '^') return c; @@ -3509,22 +3509,31 @@ int hyphen_trie::hpf_getc(FILE *f) if (c != '^') goto fail; c = getc(f); - if (c >= '0' && c <= '9') - cc = (c - '0') * 16; - else if (c >= 'a' && c <= 'f') - cc = (c - 'a' + 10) * 16; - else - goto fail; - c = getc(f); - if (c >= '0' && c <= '9') - cc += c - '0'; - else if (c >= 'a' && c <= 'f') - cc += c - 'a' + 10; - else - goto fail; + c1 = getc(f); + if (((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f')) + && ((c1 >= '0' && c1 <= '9') || (c1 >= 'a' && c1 <= 'f'))) { + if (c >= '0' && c <= '9') + c -= '0'; + else + c = c - 'a' + 10; + if (c1 >= '0' && c1 <= '9') + c1 -= '0'; + else + c1 = c1 - 'a' + 10; + cc = c * 16 + c1; + } + else { + ungetc(c1, f); + if (c >= 0 && c <= 63) + cc = c + 64; + else if (c >= 64 && c <= 127) + cc = c - 64; + else + goto fail; + } return cc; fail: - error("`^' only allowed as `^^xx' in hyphenation patterns file"); + error("invalid ^, ^^x, or ^^xx character in hyphenation patterns file"); return c; } |