Small fix to pp_gmtime
Artur Bergman [Tue, 10 Jul 2001 19:54:52 +0000 (21:54 +0200)]
Message-ID: <B7710E0B.21C5%artur@contiller.se>

p4raw-id: //depot/perl@11264

pp_sys.c

index 29bc12a..5be0b2d 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4323,10 +4323,10 @@ PP(pp_gmtime)
     else
        tmbuf = gmtime(&when);
 
-    EXTEND(SP, 9);
-    EXTEND_MORTAL(9);
     if (GIMME != G_ARRAY) {
        SV *tsv;
+        EXTEND(SP, 1);
+        EXTEND_MORTAL(1);
        if (!tmbuf)
            RETPUSHUNDEF;
        tsv = Perl_newSVpvf(aTHX_ "%s %s %2d %02d:%02d:%02d %d",
@@ -4340,7 +4340,9 @@ PP(pp_gmtime)
        PUSHs(sv_2mortal(tsv));
     }
     else if (tmbuf) {
-       PUSHs(sv_2mortal(newSViv(tmbuf->tm_sec)));
+        EXTEND(SP, 9);
+        EXTEND_MORTAL(9);
+        PUSHs(sv_2mortal(newSViv(tmbuf->tm_sec)));
        PUSHs(sv_2mortal(newSViv(tmbuf->tm_min)));
        PUSHs(sv_2mortal(newSViv(tmbuf->tm_hour)));
        PUSHs(sv_2mortal(newSViv(tmbuf->tm_mday)));