summaryrefslogtreecommitdiff
path: root/lib/Term/Cap.pm
diff options
context:
space:
mode:
authorJonathan Stowe <gellyfish@gellyfish.com>2007-11-12 21:34:17 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-11-13 09:26:13 +0000
commit305a762d63a6d064bc909c04b1edf564956f3bab (patch)
tree8ac995fc468f6a9f5cd79d77f89e391a2622bb11 /lib/Term/Cap.pm
parentf9f7a334084020b61a4116a8c8f842b1f027ab83 (diff)
downloadperl-305a762d63a6d064bc909c04b1edf564956f3bab.tar.gz
Re: 5.10 code freeze and dual-life modules
Message-Id: <1194903257.6243.8.camel@coriolanus> p4raw-id: //depot/perl@32301
Diffstat (limited to 'lib/Term/Cap.pm')
-rw-r--r--lib/Term/Cap.pm46
1 files changed, 33 insertions, 13 deletions
diff --git a/lib/Term/Cap.pm b/lib/Term/Cap.pm
index d86e7581b2..f7cf3dd629 100644
--- a/lib/Term/Cap.pm
+++ b/lib/Term/Cap.pm
@@ -19,7 +19,7 @@ use strict;
use vars qw($VERSION $VMS_TERMCAP);
use vars qw($termpat $state $first $entry);
-$VERSION = '1.10';
+$VERSION = '1.11';
# Version undef: Thu Dec 14 20:02:42 CST 1995 by sanders@bsdi.com
# Version 1.00: Thu Nov 30 23:34:29 EST 2000 by schwern@pobox.com
@@ -53,6 +53,8 @@ $VERSION = '1.10';
# Don't use try to use $ENV{HOME} if it doesn't exist
# Give Win32 'dumb' if TERM isn't set
# Provide fallback 'dumb' termcap entry as last resort
+# Version 1.11: Thu Oct 25 09:33:07 BST 2007
+# EBDIC fixes from Chun Bing Ge <gecb@cn.ibm.com>
# TODO:
# support Berkeley DB termcaps
@@ -418,18 +420,36 @@ sub Tgetent
# print STDERR "DEBUG: string $1 = $2\n";
next if defined $self->{ '_' . ( $cap = $1 ) };
$_ = $2;
- s/\\E/\033/g;
- s/\\(\d\d\d)/pack('c',oct($1) & 0177)/eg;
- s/\\n/\n/g;
- s/\\r/\r/g;
- s/\\t/\t/g;
- s/\\b/\b/g;
- s/\\f/\f/g;
- s/\\\^/\377/g;
- s/\^\?/\177/g;
- s/\^(.)/pack('c',ord($1) & 31)/eg;
- s/\\(.)/$1/g;
- s/\377/^/g;
+ if ( ord('A') == 193 )
+ {
+ s/\\E/\047/g;
+ s/\\(\d\d\d)/pack('c',oct($1) & 0177)/eg;
+ s/\\n/\n/g;
+ s/\\r/\r/g;
+ s/\\t/\t/g;
+ s/\\b/\b/g;
+ s/\\f/\f/g;
+ s/\\\^/\337/g;
+ s/\^\?/\007/g;
+ s/\^(.)/pack('c',ord($1) & 31)/eg;
+ s/\\(.)/$1/g;
+ s/\337/^/g;
+ }
+ else
+ {
+ s/\\E/\033/g;
+ s/\\(\d\d\d)/pack('c',oct($1) & 0177)/eg;
+ s/\\n/\n/g;
+ s/\\r/\r/g;
+ s/\\t/\t/g;
+ s/\\b/\b/g;
+ s/\\f/\f/g;
+ s/\\\^/\377/g;
+ s/\^\?/\177/g;
+ s/\^(.)/pack('c',ord($1) & 31)/eg;
+ s/\\(.)/$1/g;
+ s/\377/^/g;
+ }
$self->{ '_' . $cap } = $_;
}