diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp index 882ad7dc..6c8198e6 100644 --- a/src/roff/troff/env.cpp +++ b/src/roff/troff/env.cpp @@ -1657,8 +1657,15 @@ void no_hyphenate() void hyphenate_request() { int n; + static int n_max = (HYPHEN_NOT_LAST_LINE | HYPHEN_NOT_LAST_CHARS + | HYPHEN_NOT_FIRST_CHARS | HYPHEN_LAST_CHAR + | HYPHEN_FIRST_CHAR); + if (has_arg() && get_integer(&n)) { - if (((n & HYPHEN_FIRST_CHAR) && (n & HYPHEN_NOT_FIRST_CHARS)) + if (n > n_max) { + warning(WARN_RANGE, "hyphenation request value '%1' not " + "supported (maximum %2); ignored", n, n_max); + } else if (((n & HYPHEN_FIRST_CHAR) && (n & HYPHEN_NOT_FIRST_CHARS)) || ((n & HYPHEN_LAST_CHAR) && (n & HYPHEN_NOT_LAST_CHARS))) warning(WARN_SYNTAX, "contradicting hyphenation flags, ignored"); else