[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, gawk-4.0-stable, updated. 123a03a71df859
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.0-stable, updated. 123a03a71df8594a8878d464ed9826fbb827709d |
Date: |
Tue, 01 May 2012 20:15:00 +0000 |
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-4.0-stable has been updated
via 123a03a71df8594a8878d464ed9826fbb827709d (commit)
from 3a4c3d7b0c2f683c191429ea9e3b88b2a958f965 (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=123a03a71df8594a8878d464ed9826fbb827709d
commit 123a03a71df8594a8878d464ed9826fbb827709d
Author: Arnold D. Robbins <address@hidden>
Date: Tue May 1 23:14:40 2012 +0300
Merge with grep - RRI now in dfa.c!
diff --git a/ChangeLog b/ChangeLog
index f818326..26f9adb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-05-01 Arnold D. Robbins <address@hidden>
+
+ * dfa.c: Sync with GNU grep. RRI code now there, needed additional
+ change for gawk.
+ * configure.ac: Add check for stdbool.h.
+ * regex.c: Add check for if not have stdbool.h, then define the
+ bool stuff.
+
2012-04-27 Arnold D. Robbins <address@hidden>
* dfa.c: Sync with GNU grep.
diff --git a/configh.in b/configh.in
index b186fec..503fd06 100644
--- a/configh.in
+++ b/configh.in
@@ -177,6 +177,9 @@
/* Define to 1 if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
+/* Define to 1 if you have the <stdbool.h> header file. */
+#undef HAVE_STDBOOL_H
+
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
diff --git a/configure b/configure
index e678fb1..0d4cb6c 100755
--- a/configure
+++ b/configure
@@ -8222,7 +8222,7 @@ $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
fi
for ac_header in arpa/inet.h fcntl.h limits.h locale.h libintl.h mcheck.h \
- netdb.h netinet/in.h stdarg.h stddef.h string.h \
+ netdb.h netinet/in.h stdarg.h stddef.h stdbool.h string.h \
sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h \
termios.h stropts.h wchar.h wctype.h
do :
diff --git a/configure.ac b/configure.ac
index 274ec85..d618476 100644
--- a/configure.ac
+++ b/configure.ac
@@ -138,7 +138,7 @@ AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS(arpa/inet.h fcntl.h limits.h locale.h libintl.h mcheck.h \
- netdb.h netinet/in.h stdarg.h stddef.h string.h \
+ netdb.h netinet/in.h stdarg.h stddef.h stdbool.h string.h \
sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h \
termios.h stropts.h wchar.h wctype.h)
diff --git a/dfa.c b/dfa.c
index 39c0706..161425a 100644
--- a/dfa.c
+++ b/dfa.c
@@ -36,6 +36,14 @@
#if HAVE_SETLOCALE
#include <locale.h>
#endif
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#else
+#define bool int
+#define true (1)
+#define false (0)
+#endif /* HAVE_STDBOOL_H */
+
#define STREQ(a, b) (strcmp (a, b) == 0)
@@ -61,10 +69,6 @@
#endif
#ifdef GAWK
-#define bool int
-#define true (1)
-#define false (0)
-
/* The __pure__ attribute was added in gcc 2.96. */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
@@ -1134,6 +1138,33 @@ parse_bracket_exp (void)
}
else
{
+#ifndef GAWK
+ /* Defer to the system regex library about the meaning
+ of range expressions. */
+ regex_t re;
+ char pattern[6] = { '[', 0, '-', 0, ']', 0 };
+ char subject[2] = { 0, 0 };
+ c1 = c;
+ if (case_fold)
+ {
+ c1 = tolower (c1);
+ c2 = tolower (c2);
+ }
+
+ pattern[1] = c1;
+ pattern[3] = c2;
+ regcomp (&re, pattern, REG_NOSUB);
+ for (c = 0; c < NOTCHAR; ++c)
+ {
+ if ((case_fold && isupper (c))
+ || (MB_CUR_MAX > 1 && btowc (c) == WEOF))
+ continue;
+ subject[0] = c;
+ if (regexec (&re, subject, 0, NULL, 0) != REG_NOMATCH)
+ setbit_case_fold_c (c, ccl);
+ }
+ regfree (&re);
+#else
c1 = c;
if (case_fold)
{
@@ -1142,6 +1173,7 @@ parse_bracket_exp (void)
}
for (c = c1; c <= c2; c++)
setbit_case_fold_c (c, ccl);
+#endif
}
colon_warning_state |= 8;
@@ -3049,8 +3081,7 @@ match_mb_charset (struct dfa *d, state_num s, position
pos, size_t idx)
/* match with a range? */
for (i = 0; i < work_mbc->nranges; i++)
{
- if (work_mbc->range_sts[i] <= wc &&
- wc <= work_mbc->range_ends[i])
+ if (work_mbc->range_sts[i] <= wc && wc <= work_mbc->range_ends[i])
goto charset_matched;
}
diff --git a/regex.c b/regex.c
index 6ca36d3..8e04609 100644
--- a/regex.c
+++ b/regex.c
@@ -64,7 +64,7 @@
#include "regex_internal.h"
#include "regex_internal.c"
-#ifdef GAWK
+#ifndef HAVE_STDBOOL_H
#define bool int
#define true (1)
#define false (0)
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 8 ++++++++
configh.in | 3 +++
configure | 2 +-
configure.ac | 2 +-
dfa.c | 43 +++++++++++++++++++++++++++++++++++++------
regex.c | 2 +-
6 files changed, 51 insertions(+), 9 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, gawk-4.0-stable, updated. 123a03a71df8594a8878d464ed9826fbb827709d,
Arnold Robbins <=