gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, feature/minrx, updated. gawk-4.1.0-5397-ge0d9423d


From: Arnold Robbins
Subject: [SCM] gawk branch, feature/minrx, updated. gawk-4.1.0-5397-ge0d9423d
Date: Thu, 19 Oct 2023 05:01:53 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, feature/minrx has been updated
       via  e0d9423db253e675e9df8b0ddabba8f5b6a32686 (commit)
      from  57784cec72730573ec449066a9e65cefaa81ae1a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=e0d9423db253e675e9df8b0ddabba8f5b6a32686

commit e0d9423db253e675e9df8b0ddabba8f5b6a32686
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Thu Oct 19 11:51:27 2023 +0300

    Small fixes.

diff --git a/re.c b/re.c
index 6cc61116..c24d17c5 100644
--- a/re.c
+++ b/re.c
@@ -314,9 +314,10 @@ make_regexp(const char *s, size_t len, bool ignorecase, 
bool dfa, bool canfatal)
 
        int ret;
        if ((ret = minrx_regncomp(& rp->mre_pat, len, buf, flags)) != 0) {
-               refree(rp);
                /* rerr already gettextized inside regex routines */
                rerr = get_minrx_regerror(ret, rp);
+
+               refree(rp);
                if (! canfatal) {
                        error("%s: /%s/", rerr, s);
                        return NULL;
@@ -324,8 +325,10 @@ make_regexp(const char *s, size_t len, bool ignorecase, 
bool dfa, bool canfatal)
                fatal("invalid regexp: %s: /%s/", rerr, s);
        }
 
+       // Allocate re_nsub + 1, since 0 is the whole thing and 1-N
+       // are for actual parenthesized subexpressions.
        emalloc(rp->mre_regs, minrx_regmatch_t *,
-                       rp->mre_pat.re_nsub * sizeof(minrx_regmatch_t), 
"make_regexp");
+                       (rp->mre_pat.re_nsub + 1) * sizeof(minrx_regmatch_t), 
"make_regexp");
 #endif
 
        /* Additional flags that help with RS as regexp. */

-----------------------------------------------------------------------

Summary of changes:
 re.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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