summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorJohn Peacock <jpeacock@rowman.com>2004-08-03 18:23:57 -0400
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-08-04 06:19:27 +0000
commitd7aa53827cc12fdf8a697328df844e16aaa58287 (patch)
tree3cdfee90125a42052b481afa420cd15c46d7b005 /perl.c
parent1be326de458e100f1527bf44371fc6d90f6f67fe (diff)
downloadperl-d7aa53827cc12fdf8a697328df844e16aaa58287.tar.gz
Final version object core patch?
Message-ID: <411048BD.3080700@rowman.com> p4raw-id: //depot/perl@23190
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c39
1 files changed, 14 insertions, 25 deletions
diff --git a/perl.c b/perl.c
index 4415d8d925..4af4e06e91 100644
--- a/perl.c
+++ b/perl.c
@@ -267,28 +267,6 @@ perl_construct(pTHXx)
init_i18nl10n(1);
SET_NUMERIC_STANDARD();
- {
- U8 *s;
- PL_patchlevel = NEWSV(0,4);
- (void)SvUPGRADE(PL_patchlevel, SVt_PVNV);
- if (PERL_REVISION > 127 || PERL_VERSION > 127 || PERL_SUBVERSION > 127)
- SvGROW(PL_patchlevel, UTF8_MAXLEN*3+1);
- s = (U8*)SvPVX(PL_patchlevel);
- /* Build version strings using "native" characters */
- s = uvchr_to_utf8(s, (UV)PERL_REVISION);
- s = uvchr_to_utf8(s, (UV)PERL_VERSION);
- s = uvchr_to_utf8(s, (UV)PERL_SUBVERSION);
- *s = '\0';
- SvCUR_set(PL_patchlevel, s - (U8*)SvPVX(PL_patchlevel));
- SvPOK_on(PL_patchlevel);
- SvNVX(PL_patchlevel) = (NV)PERL_REVISION +
- ((NV)PERL_VERSION / (NV)1000) +
- ((NV)PERL_SUBVERSION / (NV)1000000);
- SvNOK_on(PL_patchlevel); /* dual valued */
- SvUTF8_on(PL_patchlevel);
- SvREADONLY_on(PL_patchlevel);
- }
-
#if defined(LOCAL_PATCH_COUNT)
PL_localpatches = local_patches; /* For possible -v */
#endif
@@ -343,6 +321,13 @@ perl_construct(pTHXx)
PL_stashcache = newHV();
+ PL_patchlevel = newSVpv(
+ Perl_form(aTHX_ "%d.%d.%d",
+ (int)PERL_REVISION,
+ (int)PERL_VERSION,
+ (int)PERL_SUBVERSION ), 0
+ );
+
ENTER;
}
@@ -2714,14 +2699,18 @@ Perl_moreswitches(pTHX_ char *s)
s++;
return s;
case 'v':
+ if (!sv_derived_from(PL_patchlevel, "version"))
+ (void *)upg_version(PL_patchlevel);
#if !defined(DGUX)
PerlIO_printf(PerlIO_stdout(),
- Perl_form(aTHX_ "\nThis is perl, v%"VDf" built for %s",
- PL_patchlevel, ARCHNAME));
+ Perl_form(aTHX_ "\nThis is perl, v%_ built for %s",
+ vstringify(PL_patchlevel),
+ ARCHNAME));
#else /* DGUX */
/* Adjust verbose output as in the perl that ships with the DG/UX OS from EMC */
PerlIO_printf(PerlIO_stdout(),
- Perl_form(aTHX_ "\nThis is perl, version %vd\n", PL_patchlevel));
+ Perl_form(aTHX_ "\nThis is perl, v%_\n",
+ vstringify(PL_patchlevel)));
PerlIO_printf(PerlIO_stdout(),
Perl_form(aTHX_ " built under %s at %s %s\n",
OSNAME, __DATE__, __TIME__));