diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-12-04 16:50:50 -0500 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-12-04 16:50:50 -0500 |
commit | 16761af5b3cec40f1e341cb33787af33cb2b45c2 (patch) | |
tree | d29bc360a9c234bed55a2922d8fcca3fbe89f2a8 /gawkapi.c | |
parent | 4a20341b487c17b49fc455ba37df84946eda38a7 (diff) | |
download | egawk-16761af5b3cec40f1e341cb33787af33cb2b45c2.tar.gz egawk-16761af5b3cec40f1e341cb33787af33cb2b45c2.tar.bz2 egawk-16761af5b3cec40f1e341cb33787af33cb2b45c2.zip |
Improve API regex support.
Diffstat (limited to 'gawkapi.c')
-rw-r--r-- | gawkapi.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -449,7 +449,11 @@ assign_string(NODE *node, awk_value_t *val) static inline void assign_regex(NODE *node, awk_value_t *val) { - assign_string(node, val); + /* a REGEX node cannot be an unterminated field string */ + assert((node->flags & MALLOC) != 0); + assert(node->stptr[node->stlen] == '\0'); + val->str_value.str = node->stptr; + val->str_value.len = node->stlen; val->val_type = AWK_REGEX; } |