Re: prototype of substr
Simon Cozens [Sun, 10 Dec 2000 00:13:33 +0000 (00:13 +0000)]
Message-ID: <20001210001333.A16221@deep-dark-truthful-mirror.perlhacker.org>

Make CORE::substr to be '$$;$$' instead of '$$;$;$'.
In other words, make the returned prototypes for any function
stop prepending the ';' optionality marker after the first one.
       If they start getting optional, all the rest are optional.

p4raw-id: //depot/perl@8064

pp.c

diff --git a/pp.c b/pp.c
index c512db3..f125d56 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -427,7 +427,7 @@ PP(pp_prototype)
              found:
                oa = PL_opargs[i] >> OASHIFT;
                while (oa) {
-                   if (oa & OA_OPTIONAL) {
+                   if (oa & OA_OPTIONAL && !seen_question) {
                        seen_question = 1;
                        str[n++] = ';';
                    }