summaryrefslogtreecommitdiff
path: root/ext/B
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-01-27 21:47:29 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-01-27 21:47:29 +0000
commitce561ef2a2e40559428a2f37f9211123e7481f9d (patch)
tree80f70a897b3f3e6cadfac28039f99d98522cbe95 /ext/B
parent9fc0d0ff4aeaacdcd4293755225abd917403bbc2 (diff)
downloadperl-ce561ef2a2e40559428a2f37f9211123e7481f9d.tar.gz
B::cstring() and B::Deparse EBCDIC fixes from Rafael Garcia-Suarez.
p4raw-id: //depot/perl@14451
Diffstat (limited to 'ext/B')
-rw-r--r--ext/B/B.xs12
-rw-r--r--ext/B/B/Deparse.pm2
2 files changed, 11 insertions, 3 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs
index 9b7fa9d683..c731c98e18 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -251,7 +251,11 @@ cstring(pTHX_ SV *sv)
sprintf(escbuff, "\\%03o", '?');
sv_catpv(sstr, escbuff);
}
- else if (*s >= ' ' && *s < 127) /* XXX not portable */
+#ifdef EBCDIC
+ else if (isPRINT(*s))
+#else
+ else if (*s >= ' ' && *s < 127)
+#endif /* EBCDIC */
sv_catpvn(sstr, s, 1);
else if (*s == '\n')
sv_catpv(sstr, "\\n");
@@ -292,7 +296,11 @@ cchar(pTHX_ SV *sv)
sv_catpv(sstr, "\\'");
else if (*s == '\\')
sv_catpv(sstr, "\\\\");
- else if (*s >= ' ' && *s < 127) /* XXX not portable */
+#ifdef EBCDIC
+ else if (isPRINT(8s))
+#else
+ else if (*s >= ' ' && *s < 127)
+#endif /* EBCDIC */
sv_catpvn(sstr, s, 1);
else if (*s == '\n')
sv_catpv(sstr, "\\n");
diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm
index c373a69299..fe1dc106a4 100644
--- a/ext/B/B/Deparse.pm
+++ b/ext/B/B/Deparse.pm
@@ -3074,7 +3074,7 @@ sub re_unback {
my($str) = @_;
# the insane complexity here is due to the behaviour of "\c\"
- $str =~ s/(^|[^\\]|\\c\\)(?<!\\c)\\(\\\\)*(?=[\0-\031\177-\377])/$1$2/g;
+ $str =~ s/(^|[^\\]|\\c\\)(?<!\\c)\\(\\\\)*(?=[^[:print:]])/$1$2/g;
return $str;
}