diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-07-27 15:25:05 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-07-27 15:25:05 +0300 |
commit | 207fc1458c7f168822e454a89f23428c64163427 (patch) | |
tree | 7b3512fa6f33491682c6d96d72d4cb61de9533ab /io.c | |
parent | 0544971abd3bf6eda1531e62b4a19e221a68a6e5 (diff) | |
download | egawk-207fc1458c7f168822e454a89f23428c64163427.tar.gz egawk-207fc1458c7f168822e454a89f23428c64163427.tar.bz2 egawk-207fc1458c7f168822e454a89f23428c64163427.zip |
Fix bug in API set_RT, bug in readdir.c.
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -332,7 +332,7 @@ after_beginfile(IOBUF **curfile) } /* - * Open hooks could have been changed by BEGINFILE, + * Input parsers could have been changed by BEGINFILE, * so delay check until now. */ @@ -2678,14 +2678,18 @@ set_RT_to_null() } } -/* set_RT --- real function for use by extension API */ +/* set_RT --- real function **** for use by extension API **** */ void -set_RT(const char *str, size_t len) +set_RT(NODE *n) { - if (! do_traditional) { + if (do_traditional) + unref(n); + else if (RT_node->var_value == n) + assert(n == Nnull_string); /* do nothing */ + else { unref(RT_node->var_value); - RT_node->var_value = make_str_node(str, len, ALREADY_MALLOCED); + RT_node->var_value = n; } } |