This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix getting prototype of builtins mkdir and setpgrp.
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Tue, 3 May 2005 15:43:34 +0000 (15:43 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Tue, 3 May 2005 15:43:34 +0000 (15:43 +0000)
Hardcode special exceptions for exec and system, instead
of trying to be clever and failing.

p4raw-id: //depot/perl@24380

opcode.h
opcode.pl
pp.c
t/op/cproto.t

index 8161c70..8c85157 100644 (file)
--- a/opcode.h
+++ b/opcode.h
@@ -2,7 +2,7 @@
  *    opcode.h
  *
  *    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- *    2000, 2001, 2002, 2003, 2004, by Larry Wall and others
+ *    2000, 2001, 2002, 2003, 2004, 2005 by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
index cef6e0c..bda960d 100755 (executable)
--- a/opcode.pl
+++ b/opcode.pl
@@ -41,7 +41,7 @@ print <<"END";
  *    opcode.h
  *
  *    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- *    2000, 2001, 2002, 2003, 2004, by Larry Wall and others
+ *    2000, 2001, 2002, 2003, 2004, 2005 by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/pp.c b/pp.c
index 2ba5b61..fa32601 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -388,7 +388,8 @@ PP(pp_prototype)
                I32 oa;
                char str[ MAX_ARGS_OP * 2 + 2 ]; /* One ';', one '\0' */
 
-               if (code == -KEY_chop || code == -KEY_chomp)
+               if (code == -KEY_chop || code == -KEY_chomp
+                       || code == -KEY_exec || code == -KEY_system)
                    goto set;
                while (i < MAXO) {      /* The slow way. */
                    if (strEQ(s + 6, PL_op_name[i])
@@ -406,8 +407,6 @@ PP(pp_prototype)
                        seen_question = 1;
                        str[n++] = ';';
                    }
-                   else if (n && str[0] == ';' && seen_question)
-                       goto set;       /* XXXX system, exec */
                    if ((oa & (OA_OPTIONAL - 1)) >= OA_AVREF
                        && (oa & (OA_OPTIONAL - 1)) <= OA_SCALARREF
                        /* But globs are already references (kinda) */
index a50a851..d37118e 100644 (file)
@@ -137,7 +137,7 @@ lstat (*)
 lt ($$)
 m undef
 map undef
-mkdir ()
+mkdir (;$$)
 msgctl ($$$)
 msgget ($$)
 msgrcv ($$$$$)
@@ -197,7 +197,7 @@ send (*$$;$)
 setgrent ()
 sethostent ($)
 setnetent ($)
-setpgrp undef
+setpgrp (;$$)
 setpriority ($$$)
 setprotoent ($)
 setpwent ()