diff options
author | Karl Williamson <khw@khw-desktop.(none)> | 2010-05-12 11:50:19 -0600 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-05-17 10:19:45 +0200 |
commit | 6ae9f32af6f08fad4023edda45596d5c654483de (patch) | |
tree | dd28d23beba82e55a20c728cf080aa35caffc92f /util.c | |
parent | 3e462cdc2087ddf90984010fabd80c30db92bfa0 (diff) | |
download | perl-6ae9f32af6f08fad4023edda45596d5c654483de.tar.gz |
PATCH: Clean up EBCDIC handling of \cX
The function perl_ebcdic_control() is unnecessary, as the toCTRL macro
that calls it can be changed to just map EBCDIC to ASCII first, and then
doing the normal procedure.
This means that EBCDIC and ASCII will no longer diverge. Currently,
EBCIDIC gives a syntax error for inputs outside its domain, whereas the
ASCII version accepts some of them.
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 40 |
1 files changed, 0 insertions, 40 deletions
@@ -3832,46 +3832,6 @@ Perl_report_evil_fh(pTHX_ const GV *gv, const IO *io, I32 op) } } -#ifdef EBCDIC -/* in ASCII order, not that it matters */ -static const char controllablechars[] = "?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"; - -int -Perl_ebcdic_control(pTHX_ int ch) -{ - if (ch > 'a') { - const char *ctlp; - - if (islower(ch)) - ch = toupper(ch); - - if ((ctlp = strchr(controllablechars, ch)) == 0) { - Perl_die(aTHX_ "unrecognised control character '%c'\n", ch); - } - - if (ctlp == controllablechars) - return('\177'); /* DEL */ - else - return((unsigned char)(ctlp - controllablechars - 1)); - } else { /* Want uncontrol */ - if (ch == '\177' || ch == -1) - return('?'); - else if (ch == '\157') - return('\177'); - else if (ch == '\174') - return('\000'); - else if (ch == '^') /* '\137' in 1047, '\260' in 819 */ - return('\036'); - else if (ch == '\155') - return('\037'); - else if (0 < ch && ch < (sizeof(controllablechars) - 1)) - return(controllablechars[ch+1]); - else - Perl_die(aTHX_ "invalid control request: '\\%03o'\n", ch & 0xFF); - } -} -#endif - /* XXX Add documentation after final interface and behavior is decided */ /* May want to show context for error, so would pass Perl_bslash_c(pTHX_ const char* current, const char* start, const bool output_warning) U8 source = *current; |