diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:54:45 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:54:45 +0300 |
commit | f20ab7c3039a4023f41372bfe4bde3b16d481df7 (patch) | |
tree | 4425de8c6177df655f165cb61d70d0acb5fdc968 /array.c | |
parent | 6607eb3d5e40b98d2acc8f6b0d6a0b5a4b0f56bd (diff) | |
download | egawk-f20ab7c3039a4023f41372bfe4bde3b16d481df7.tar.gz egawk-f20ab7c3039a4023f41372bfe4bde3b16d481df7.tar.bz2 egawk-f20ab7c3039a4023f41372bfe4bde3b16d481df7.zip |
Move to gawk-3.0.4.
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991 - 97 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-1999 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -272,7 +272,10 @@ NODE *symbol, *subs; fatal("attempt to use scalar as array"); if (symbol->var_array == NULL) { - symbol->type = Node_var_array; + if (symbol->type != Node_var_array) { + unref(symbol->var_value); + symbol->type = Node_var_array; + } symbol->array_size = symbol->table_size = 0; /* sanity */ symbol->flags &= ~ARRAYMAXED; grow_table(symbol); @@ -360,13 +363,14 @@ NODE *symbol, *tree; last = bucket, bucket = bucket->ahnext) if (cmp_nodes(bucket->ahname, subs) == 0) break; - free_temp(subs); if (bucket == NULL) { if (do_lint) warning("delete: index `%s' not in array `%s'", subs->stptr, symbol->vname); + free_temp(subs); return; } + free_temp(subs); if (last != NULL) last->ahnext = bucket->ahnext; else |