summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-08-08 22:18:54 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-08-08 22:18:54 +0000
commit84df6dbaac5dcce30923bafc61c52f3ffa1b669b (patch)
treecf12e2c57eeb3ade406af6984e8a91a4ea05a830 /sv.c
parent527cc686938e627799b4befb57128e2e7c3272c2 (diff)
parent1eccc87f4ae921520ce1893dd988f4a8a1fa061d (diff)
downloadperl-84df6dbaac5dcce30923bafc61c52f3ffa1b669b.tar.gz
integrate maint-5.005 changes into mainline
p4raw-id: //depot/perl@1760
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/sv.c b/sv.c
index 278ad8b781..b77c399520 100644
--- a/sv.c
+++ b/sv.c
@@ -2097,7 +2097,6 @@ sv_setsv(SV *dstr, register SV *sstr)
if (sflags & SVf_ROK) {
if (dtype >= SVt_PV) {
if (dtype == SVt_PVGV) {
- dTHR;
SV *sref = SvREFCNT_inc(SvRV(sstr));
SV *dref = 0;
int intro = GvINTRO(dstr);
@@ -2886,7 +2885,8 @@ sv_clear(register SV *sv)
stash = NULL;
switch (SvTYPE(sv)) {
case SVt_PVIO:
- if (IoIFP(sv) != PerlIO_stdin() &&
+ if (IoIFP(sv) &&
+ IoIFP(sv) != PerlIO_stdin() &&
IoIFP(sv) != PerlIO_stdout() &&
IoIFP(sv) != PerlIO_stderr())
io_close((IO*)sv);
@@ -3620,10 +3620,24 @@ sv_inc(register SV *sv)
*(d--) = '0';
}
else {
+#ifdef EBCDIC
+ /* MKS: The original code here died if letters weren't consecutive.
+ * at least it didn't have to worry about non-C locales. The
+ * new code assumes that ('z'-'a')==('Z'-'A'), letters are
+ * arranged in order (although not consecutively) and that only
+ * [A-Za-z] are accepted by isALPHA in the C locale.
+ */
+ if (*d != 'z' && *d != 'Z') {
+ do { ++*d; } while (!isALPHA(*d));
+ return;
+ }
+ *(d--) -= 'z' - 'a';
+#else
++*d;
if (isALPHA(*d))
return;
*(d--) -= 'z' - 'a' + 1;
+#endif
}
}
/* oh,oh, the number grew */