aboutsummaryrefslogtreecommitdiffstats
path: root/ext.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext.c')
-rw-r--r--ext.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext.c b/ext.c
index f3e783da..bb090d0f 100644
--- a/ext.c
+++ b/ext.c
@@ -229,8 +229,15 @@ get_argument(int i)
t = GET_PARAM(i);
- if (t->type == Node_array_ref)
+ if (t->type == Node_array_ref) {
+ if (t->orig_array->type == Node_var) {
+ /* already a scalar, can no longer use it as array */
+ t->type = Node_var;
+ t->var_value = Nnull_string;
+ return t;
+ }
return t->orig_array; /* Node_var_new or Node_var_array */
+ }
if (t->type == Node_var_new || t->type == Node_var_array)
return t;
return t->var_value;