bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regexp Provoking an Error Message Contains \y but the Error Message


From: arnold
Subject: Re: Regexp Provoking an Error Message Contains \y but the Error Message Displays \b
Date: Sat, 31 Oct 2020 11:31:21 -0600
User-agent: Heirloom mailx 12.5 7/5/10

Hi again.

> It looks like I can put the original regexp into the error message.
> I will work on a patch to do that.

See below.

> It's interesting that you use \y.  I tend to you \< and \>
                                               ^^^ ---> "use"

Sigh. As I get older I make more and more typos. No fun.

Thanks,

Arnold
--------------------------------------------
diff --git a/re.c b/re.c
index fb28c563..d9191a1f 100644
--- a/re.c
+++ b/re.c
@@ -258,10 +258,10 @@ make_regexp(const char *s, size_t len, bool ignorecase, 
bool dfa, bool canfatal)
                refree(rp);
                if (! canfatal) {
                        /* rerr already gettextized inside regex routines */
-                       error("%s: /%s/", rerr, buf);
+                       error("%s: /%.*s/", rerr, len, s);
                        return NULL;
                }
-               fatal("invalid regexp: %s: /%s/", rerr, buf);
+               fatal("invalid regexp: %s: /%.*s/", rerr, len, s);
        }
 
        /* gack. this must be done *after* re_compile_pattern */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]