summaryrefslogtreecommitdiff
path: root/ext/File-Glob/Glob.xs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/File-Glob/Glob.xs')
-rw-r--r--ext/File-Glob/Glob.xs2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/File-Glob/Glob.xs b/ext/File-Glob/Glob.xs
index e0a36814e0..9779d54ca6 100644
--- a/ext/File-Glob/Glob.xs
+++ b/ext/File-Glob/Glob.xs
@@ -121,7 +121,7 @@ iterate(pTHX_ bool(*globber)(pTHX_ AV *entries, const char *pat, STRLEN len, boo
/* chuck it all out, quick or slow */
if (gimme == G_ARRAY) {
- if (!on_stack) {
+ if (!on_stack && AvFILLp(entries) + 1) {
EXTEND(SP, AvFILLp(entries)+1);
Copy(AvARRAY(entries), SP+1, AvFILLp(entries)+1, SV *);
SP += AvFILLp(entries)+1;