[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4272-gf056f0a
From: |
Arnold Robbins |
Subject: |
[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4272-gf056f0a |
Date: |
Thu, 15 Jul 2021 14:54:35 -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 f056f0a42953c9297f60335421ccd7609cba698e (commit)
from 41b120c7a932b6bb9eccb24b03475a74ca1303ca (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=f056f0a42953c9297f60335421ccd7609cba698e
commit f056f0a42953c9297f60335421ccd7609cba698e
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Thu Jul 15 21:54:21 2021 +0300
Update testdfa.c.
diff --git a/helpers/ChangeLog b/helpers/ChangeLog
index d7b9415..d8e12b4 100644
--- a/helpers/ChangeLog
+++ b/helpers/ChangeLog
@@ -1,3 +1,7 @@
+2021-07-15 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testdfa.c (main): Bug fix and new -b option.
+
2021-05-12 Arnold D. Robbins <arnold@skeeve.com>
* update-support.sh: Fix list of files to copy over.
diff --git a/helpers/testdfa.c b/helpers/testdfa.c
index 0f7911a..426aab8 100644
--- a/helpers/testdfa.c
+++ b/helpers/testdfa.c
@@ -25,6 +25,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA
*/
+#include <config.h>
+
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
@@ -44,7 +46,7 @@
#undef _Noreturn
#define _Noreturn
-#define _GL_ATTRIBUTE_PURE
+/*#define _GL_ATTRIBUTE_PURE */
#include "dfa.h"
#include "localeinfo.h"
@@ -88,6 +90,7 @@ int main(int argc, char **argv)
char save;
size_t count = 0;
char *place;
+ bool not_bol = false;
struct localeinfo localeinfo;
if (argc < 2)
@@ -100,8 +103,11 @@ int main(int argc, char **argv)
syn = RE_SYNTAX_GNU_AWK;
/* parse options, update syntax, ignorecase */
- while ((c = getopt(argc, argv, "pit")) != -1) {
+ while ((c = getopt(argc, argv, "bpit")) != -1) {
switch (c) {
+ case 'b':
+ not_bol = true;
+ break;
case 'i':
ignorecase = true;
break;
@@ -173,6 +179,7 @@ int main(int argc, char **argv)
/* gack. this must be done *after* re_compile_pattern */
pat.newline_anchor = false; /* don't get \n in middle of string */
+ pat.not_bol = not_bol;
dfareg = dfaalloc();
init_localeinfo(&localeinfo);
@@ -185,9 +192,10 @@ int main(int argc, char **argv)
data = databuf(STDIN_FILENO);
+ len = strlen(data);
/* run the regex matcher */
- ret = re_search(& pat, data, len, 0, len, NULL);
+ ret = re_search(& pat, data, len, 0, len, ®s);
printf("re_search returned position %d (%s)\n", ret, (ret >= 0) ?
"true" : "false");
/* run the dfa matcher */
-----------------------------------------------------------------------
Summary of changes:
helpers/ChangeLog | 4 ++++
helpers/testdfa.c | 14 +++++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4272-gf056f0a,
Arnold Robbins <=