glob() takes one or no user arguments and a non-user-visible second
Gurusamy Sarathy [Sun, 20 Feb 2000 16:34:33 +0000 (16:34 +0000)]
hidden argument, fix its prototype-checking accordingly

p4raw-id: //depot/perl@5163

op.c
opcode.h
opcode.pl

diff --git a/op.c b/op.c
index eb60ec1..9ba8582 100644 (file)
--- a/op.c
+++ b/op.c
@@ -5504,6 +5504,7 @@ Perl_ck_glob(pTHX_ OP *o)
 {
     GV *gv;
 
+    o = ck_fun(o);
     if ((o->op_flags & OPf_KIDS) && !cLISTOPo->op_first->op_sibling)
        append_elem(OP_GLOB, o, newDEFSVOP());
 
@@ -5542,7 +5543,7 @@ Perl_ck_glob(pTHX_ OP *o)
     gv_IOadd(gv);
     append_elem(OP_GLOB, o, newGVOP(OP_GV, 0, gv));
     scalarkids(o);
-    return ck_fun(o);
+    return o;
 }
 
 OP *
index 9d9cd52..51c2d11 100644 (file)
--- a/opcode.h
+++ b/opcode.h
@@ -1477,7 +1477,7 @@ EXT U32 PL_opargs[] = {
        0x0001368c,     /* ref */
        0x00122804,     /* bless */
        0x00001608,     /* backtick */
-       0x00132808,     /* glob */
+       0x00012808,     /* glob */
        0x00001608,     /* readline */
        0x00001608,     /* rcatline */
        0x00002204,     /* regcmaybe */
index 0dfb9e7..abf59a4 100755 (executable)
--- a/opcode.pl
+++ b/opcode.pl
@@ -379,7 +379,7 @@ bless               bless                   ck_fun          s@      S S?
 
 backtick       quoted execution (``, qx)       ck_null         t%      
 # glob defaults its first arg to $_
-glob           glob                    ck_glob         t@      S? S?
+glob           glob                    ck_glob         t@      S?
 readline       <HANDLE>                ck_null         t%      
 rcatline       append I/O operator     ck_null         t%