summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1998-08-01 15:03:02 +0300
committerGurusamy Sarathy <gsar@cpan.org>1998-08-02 05:20:12 +0000
commit9d116dd7c895b17badf4ad422ae44da0c4df7bc2 (patch)
tree6e0cd77e3539952c892983238473264f672472b9 /sv.c
parente6df7ed16ebd06f5315f3016c00996876580109c (diff)
downloadperl-9d116dd7c895b17badf4ad422ae44da0c4df7bc2.tar.gz
support OE/MVS
Message-Id: <199808010903.MAA09371@alpha.hut.fi> Subject: [PATCH] 5.005_01: OE MVS p4raw-id: //depot/maint-5.005/perl@1697
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index d669ee71a6..a53e76979e 100644
--- a/sv.c
+++ b/sv.c
@@ -3540,10 +3540,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 */