diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | Makefile.am | 15 | ||||
-rw-r--r-- | Makefile.in | 10 | ||||
-rw-r--r-- | dfa.c | 17 |
4 files changed, 40 insertions, 13 deletions
@@ -1,3 +1,14 @@ +2015-10-16 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (SUBDIRS): Fix ordering so that + make check directly after configure works properly. + Thanks to Michal Jaegermann <michal.jnn@gmail.com> + for the report. + + Unrelated: + + * dfa.c: Sync with GNU grep. + 2015-10-11 Arnold D. Robbins <arnold@skeeve.com> * awkgram.y (yylex): Fix invalid read problems. diff --git a/Makefile.am b/Makefile.am index 342df292..460f9114 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,21 +59,24 @@ EXTRA_DIST = \ ylwrap # The order to do things in. +# # Build explicitly in "." in order to build gawk first, so # that `make check' without a prior `make' works. +# +# Build in extension before test so that +# ./configure && make check +# works properly too. +# # Build in awklib after in doc, since we want to extract # sample files if doc/gawk.texi changed. -SUBDIRS = \ - . \ - doc \ - awklib \ - po \ - test +SUBDIRS = . if ENABLE_EXTENSIONS SUBDIRS += extension endif +SUBDIRS += doc awklib po test + # what to make and install bin_PROGRAMS = gawk include_HEADERS = gawkapi.h diff --git a/Makefile.in b/Makefile.in index c327d1b6..d5bd302d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -262,7 +262,7 @@ am__define_uniq_tagged_files = \ ETAGS = etags CTAGS = ctags CSCOPE = cscope -DIST_SUBDIRS = . doc awklib po test extension +DIST_SUBDIRS = . extension doc awklib po test am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/configh.in ABOUT-NLS \ AUTHORS COPYING ChangeLog INSTALL NEWS README TODO awkgram.c \ command.c compile config.guess config.rpath config.sub depcomp \ @@ -477,11 +477,17 @@ EXTRA_DIST = \ # The order to do things in. +# # Build explicitly in "." in order to build gawk first, so # that `make check' without a prior `make' works. +# +# Build in extension before test so that +# ./configure && make check +# works properly too. +# # Build in awklib after in doc, since we want to extract # sample files if doc/gawk.texi changed. -SUBDIRS = . doc awklib po test $(am__append_1) +SUBDIRS = . $(am__append_1) doc awklib po test include_HEADERS = gawkapi.h # sources for both gawk and dgawk @@ -3970,6 +3970,9 @@ dfamust (struct dfa const *d) bool begline = false; bool endline = false; size_t rj; + bool need_begline = false; + bool need_endline = false; + bool case_fold_unibyte = case_fold && MB_CUR_MAX == 1; struct dfamust *dm; for (ri = 0; ri < d->tindex; ++ri) @@ -3980,10 +3983,12 @@ dfamust (struct dfa const *d) case BEGLINE: mp = allocmust (mp, 2); mp->begline = true; + need_begline = true; break; case ENDLINE: mp = allocmust (mp, 2); mp->endline = true; + need_endline = true; break; case LPAREN: case RPAREN: @@ -4060,7 +4065,9 @@ dfamust (struct dfa const *d) result = mp->in[i]; if (STREQ (result, mp->is)) { - exact = true; + if ((!need_begline || mp->begline) && (!need_endline + || mp->endline)) + exact = true; begline = mp->begline; endline = mp->endline; } @@ -4133,7 +4140,7 @@ dfamust (struct dfa const *d) t = j; while (++j < NOTCHAR) if (tstbit (j, *ccl) - && ! (case_fold && MB_CUR_MAX == 1 + && ! (case_fold_unibyte && toupper (j) == toupper (t))) break; if (j < NOTCHAR) @@ -4156,17 +4163,17 @@ dfamust (struct dfa const *d) } mp = allocmust (mp, ((rj - ri) >> 1) + 1); mp->is[0] = mp->left[0] = mp->right[0] - = case_fold && MB_CUR_MAX == 1 ? toupper (t) : t; + = case_fold_unibyte ? toupper (t) : t; for (i = 1; ri + 2 < rj; i++) { ri += 2; t = d->tokens[ri]; mp->is[i] = mp->left[i] = mp->right[i] - = case_fold && MB_CUR_MAX == 1 ? toupper (t) : t; + = case_fold_unibyte ? toupper (t) : t; } mp->is[i] = mp->left[i] = mp->right[i] = '\0'; - mp->in = enlist (mp->in, mp->is, i - 1); + mp->in = enlist (mp->in, mp->is, i); break; } } |