aboutsummaryrefslogtreecommitdiffstats
path: root/extension/filefuncs.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-10-21 21:42:19 +0200
committerArnold D. Robbins <arnold@skeeve.com>2012-10-21 21:42:19 +0200
commitd61172dcf8117f4d3092a186122e3c66c17c58ba (patch)
treeadbb60a3d5fab5599dc5b4f446aa4a191c9d8662 /extension/filefuncs.c
parent104a4dbd6430d1b96dbf44601738c3652bcc85c9 (diff)
downloadegawk-d61172dcf8117f4d3092a186122e3c66c17c58ba.tar.gz
egawk-d61172dcf8117f4d3092a186122e3c66c17c58ba.tar.bz2
egawk-d61172dcf8117f4d3092a186122e3c66c17c58ba.zip
Bug fix in do_stat().
Diffstat (limited to 'extension/filefuncs.c')
-rw-r--r--extension/filefuncs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/extension/filefuncs.c b/extension/filefuncs.c
index bc2f2afc..f2479c50 100644
--- a/extension/filefuncs.c
+++ b/extension/filefuncs.c
@@ -359,6 +359,9 @@ do_stat(int nargs, awk_value_t *result)
name = file_param.str_value.str;
array = array_param.array_cookie;
+ /* always empty out the array */
+ clear_array(array);
+
/* lstat the file, if error, set ERRNO and return */
ret = lstat(name, & sbuf);
if (ret < 0) {