bug-gawk
[Top][All Lists]
Advanced

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

Re: awk: fatal: /home/corinna/tmp/gawk-5.1.0/gawk-5.1.0-1.x86_64/src/gaw


From: arnold
Subject: Re: awk: fatal: /home/corinna/tmp/gawk-5.1.0/gawk-5.1.0-1.x86_64/src/gawk-5.1.0/main.c:1206: ezalloc called with zero bytes
Date: Fri, 16 Apr 2021 08:55:12 -0600
User-agent: Heirloom mailx 12.5 7/5/10

Hi.

Ed Morton <mortoneccc@comcast.net> wrote:

> I just stumbled across this in gawk 5.1.0 on cygwin:
>
> $ awk -v s='@/' 'BEGIN{print s}'
> awk: fatal: 
> /home/corinna/tmp/gawk-5.1.0/gawk-5.1.0-1.x86_64/src/gawk-5.1.0/main.c:1206: 
> ezalloc called with zero bytes
>
> Regards,
>
>      Ed.

Thanks for the report. Here is the fix.

Arnold
-------------------
diff --git a/main.c b/main.c
index 5b153bc3..19c50b6d 100644
--- a/main.c
+++ b/main.c
@@ -1203,6 +1203,7 @@ arg_assign(char *arg, bool initing)
 
        cp2 = cp + strlen(cp) - 1;      // end char
        if (! do_traditional
+           && strlen(cp) >= 3          // '@/' doesn't do it.
            && cp[0] == '@' && cp[1] == '/' && *cp2 == '/') {
                // typed regex
                size_t len = strlen(cp) - 3;



reply via email to

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