chiark / gitweb /
Error handling: Trim the `bad escape' message.e
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 28 Dec 2019 00:28:03 +0000 (00:28 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 30 Dec 2019 11:35:15 +0000 (11:35 +0000)
Do not print the whole line, only the next 5 chars (say) - and, also,
not any newlines.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
generate

index 209a1f3..62e915f 100755 (executable)
--- a/generate
+++ b/generate
@@ -296,7 +296,8 @@ sub process_input_mk ($$$$) {
                od $_;
                $_ = '';
            } else {
-               err "bad &-escape \`$$esclitr$_'";
+               m{^.{0,5}};
+               err "bad &-escape \`$$esclitr$&'";
            }
        }
        if (defined $buffering_output) {