aboutsummaryrefslogtreecommitdiffstats
path: root/ext.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2011-05-23 22:05:10 +0300
committerArnold D. Robbins <arnold@skeeve.com>2011-05-23 22:05:10 +0300
commit7586c955f6e1b4c50614ca59c880369860298134 (patch)
tree424dc37ee71de5352d340c29738291644073982f /ext.c
parent57ae4f7df01dc9254912e6b6a71f2602eb8217c5 (diff)
downloadegawk-7586c955f6e1b4c50614ca59c880369860298134.tar.gz
egawk-7586c955f6e1b4c50614ca59c880369860298134.tar.bz2
egawk-7586c955f6e1b4c50614ca59c880369860298134.zip
Fixes for extension code and tests.
Diffstat (limited to 'ext.c')
-rw-r--r--ext.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext.c b/ext.c
index 78cc6638..f0290f99 100644
--- a/ext.c
+++ b/ext.c
@@ -274,8 +274,15 @@ get_actual_argument(int i, int optional, int want_array)
return NULL;
}
- if (t->type == Node_var_new)
- return (want_array ? get_array(t, FALSE) : t);
+ if (t->type == Node_var_new) {
+ if (want_array)
+ return get_array(t, FALSE);
+ else {
+ t->type = Node_var;
+ t->var_value = Nnull_string;
+ return Nnull_string;
+ }
+ }
if (want_array) {
if (t->type != Node_var_array)