gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4393-g2b4d1c79


From: Arnold Robbins
Subject: [SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4393-g2b4d1c79
Date: Thu, 21 Apr 2022 04:00:56 -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, gawk-5.1-stable has been updated
       via  2b4d1c796f24d1fc2fb09bd1570f859caabda419 (commit)
      from  1048bef9a1fe499c4f864425b3c75995333a474a (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=2b4d1c796f24d1fc2fb09bd1570f859caabda419

commit 2b4d1c796f24d1fc2fb09bd1570f859caabda419
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Thu Apr 21 11:00:36 2022 +0300

    Allow --- in a range to be a single minus.

diff --git a/support/ChangeLog b/support/ChangeLog
index ad8f0e1b..26acdf24 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -1,3 +1,9 @@
+2022-04-21         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * regcomp.c (peek_token_bracket): Allow "---" to be a range
+       consisting of a single minus. Thanks to Nelson Beebe for the initial
+       report, way back in May of 2015.
+
 2022-04-20         Arnold D. Robbins     <arnold@skeeve.com>
 
        * verify.h: Sync with GNULIB.
diff --git a/support/regcomp.c b/support/regcomp.c
index b607c853..adfe28e2 100644
--- a/support/regcomp.c
+++ b/support/regcomp.c
@@ -2039,7 +2039,21 @@ peek_token_bracket (re_token_t *token, re_string_t 
*input, reg_syntax_t syntax)
   switch (c)
     {
     case '-':
-      token->type = OP_CHARSET_RANGE;
+      // Special case. V7 Unix grep and Unix awk and mawk allow
+      // [...---...] (3 minus signs in a bracket expression) to represent
+      // a single minus sign.  Let's try to support that without breaking
+      // anything else.
+      if (re_string_peek_byte (input, 1) == '-' && re_string_peek_byte (input, 
2) == '-')
+       {
+          // advance past the minus signs
+          (void) re_string_fetch_byte (input);
+          (void) re_string_fetch_byte (input);
+
+          token->type = CHARACTER;
+          token->opr.c = '-';
+       }
+      else
+       token->type = OP_CHARSET_RANGE;
       break;
     case ']':
       token->type = OP_CLOSE_BRACKET;

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

Summary of changes:
 support/ChangeLog |  6 ++++++
 support/regcomp.c | 16 +++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
gawk



reply via email to

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