diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-09-08 05:50:26 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-09-08 05:50:26 +0300 |
commit | a159bf0b87d8bbb576d736ea54c97d0271166620 (patch) | |
tree | e55dce2e0a3a02104fb6157b1220cd1e7aade849 /helpers | |
parent | c49b94108f48ea56f705d8549988c00289a0e2a2 (diff) | |
download | gawk-a159bf0b87d8bbb576d736ea54c97d0271166620.tar.gz |
Merge grep dfa.
Diffstat (limited to 'helpers')
-rw-r--r-- | helpers/ChangeLog | 4 | ||||
-rw-r--r-- | helpers/testdfa.c | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/helpers/ChangeLog b/helpers/ChangeLog index 0958a021..47062233 100644 --- a/helpers/ChangeLog +++ b/helpers/ChangeLog @@ -1,3 +1,7 @@ +2016-09-08 Paul Eggert <eggert@cs.ucla.edu> + + * testdfa.c: Adjust to DFA API changes. + 2016-08-25 Arnold D. Robbins <arnold@skeeve.com> * 4.1.4: Release tar ball made. diff --git a/helpers/testdfa.c b/helpers/testdfa.c index 4495e11a..fa7715f9 100644 --- a/helpers/testdfa.c +++ b/helpers/testdfa.c @@ -44,6 +44,7 @@ #define _Noreturn #define _GL_ATTRIBUTE_PURE #include "dfa.h" +#include "localeinfo.h" const char *regexflags2str(int flags); char *databuf(int fd); @@ -71,7 +72,8 @@ void usage(const char *myname) int main(int argc, char **argv) { - int c, ret, try_backref; + int c, ret; + bool try_backref; struct re_pattern_buffer pat; struct re_registers regs; struct dfa *dfareg; @@ -84,6 +86,7 @@ int main(int argc, char **argv) char save; size_t count = 0; char *place; + struct localeinfo localeinfo; if (argc < 2) usage(argv[0]); @@ -158,7 +161,6 @@ int main(int argc, char **argv) dfa_syn = syn; if (ignorecase) dfa_syn |= RE_ICASE; - dfasyntax(dfa_syn, ignorecase, '\n'); re_set_syntax(syn); if ((rerr = re_compile_pattern(pattern, len, & pat)) != NULL) { @@ -171,6 +173,10 @@ int main(int argc, char **argv) pat.newline_anchor = false; /* don't get \n in middle of string */ dfareg = dfaalloc(); + init_localeinfo(&localeinfo); + dfasyntax(dfareg, &localeinfo, dfa_syn, + ignorecase ? DFA_CASE_FOLD : 0); + printf("Calling dfacomp(%s, %d, %p, true)\n", pattern, (int) len, dfareg); |