diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-11-16 19:43:58 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-11-16 19:43:58 +0200 |
commit | d03f6f66493d8a8a80810f51fb363dfb7bcd02a5 (patch) | |
tree | 913df94ab1d1c9397e21f8aacefba4512f752910 | |
parent | ee77f64d563188b6a5d761fd9342df00431e99d8 (diff) | |
download | egawk-d03f6f66493d8a8a80810f51fb363dfb7bcd02a5.tar.gz egawk-d03f6f66493d8a8a80810f51fb363dfb7bcd02a5.tar.bz2 egawk-d03f6f66493d8a8a80810f51fb363dfb7bcd02a5.zip |
Sync dfa with grep.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | dfa.c | 7 |
2 files changed, 9 insertions, 2 deletions
@@ -3,6 +3,10 @@ * interpret.h: Revert change of 2014-11-11 since it breaks certain uses. + Unrelated: + + * dfa.c: Sync with GNU grep. + 2014-11-15 Arnold D. Robbins <arnold@skeeve.com> * array.c, awk.h, awkgram.y, builtin.c, dfa.c, eval.c, field.c, @@ -3697,8 +3697,11 @@ dfassbuild (struct dfa *d) sup->musts = NULL; sup->charclasses = xnmalloc (sup->calloc, sizeof *sup->charclasses); - memcpy (sup->charclasses, d->charclasses, - d->cindex * sizeof *sup->charclasses); + if (d->cindex) + { + memcpy (sup->charclasses, d->charclasses, + d->cindex * sizeof *sup->charclasses); + } sup->tokens = xnmalloc (d->tindex, 2 * sizeof *sup->tokens); sup->talloc = d->tindex * 2; |