diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:18:27 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:18:27 +0300 |
commit | e1ef22d366abd1f9ec95eb495c727d55181c8584 (patch) | |
tree | cc0fee624202820eb928e60b6a096362c85ff807 /array.c | |
parent | cae8bc6ced84c12590e3554a06a952283735363a (diff) | |
download | egawk-e1ef22d366abd1f9ec95eb495c727d55181c8584.tar.gz egawk-e1ef22d366abd1f9ec95eb495c727d55181c8584.tar.bz2 egawk-e1ef22d366abd1f9ec95eb495c727d55181c8584.zip |
Move to 2.15.
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -203,11 +203,24 @@ NODE *symbol, *subs; /* It's not there, install it. */ if (do_lint && subs->stlen == 0) - warning("subscript of array is null string"); + warning("subscript of array `%s' is null string", + symbol->vname); getnode(bucket); bucket->type = Node_ahash; - bucket->ahname = dupnode(subs); + if (subs->flags & TEMP) + bucket->ahname = dupnode(subs); + else { + unsigned int saveflags = subs->flags; + + subs->flags &= ~MALLOC; + bucket->ahname = dupnode(subs); + subs->flags = saveflags; + } free_temp(subs); + + /* array subscripts are strings */ + bucket->ahname->flags &= ~NUMBER; + bucket->ahname->flags |= STRING; bucket->ahvalue = Nnull_string; bucket->ahnext = symbol->var_array[hash1]; symbol->var_array[hash1] = bucket; |