summaryrefslogtreecommitdiff
path: root/lib/Term
diff options
context:
space:
mode:
authorDaniel S. Lewart <lewart@uiuc.edu>2001-05-22 18:34:41 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-05-23 21:27:54 +0000
commite14c93b34ddde68fbc181b06ddea24be4965fadf (patch)
tree823aa7868bed8ebda380fd022e1bff1dbeb70a49 /lib/Term
parent844495fbb8769a576a75dd72ddbc0cd5b94672b6 (diff)
downloadperl-e14c93b34ddde68fbc181b06ddea24be4965fadf.tar.gz
Avoid -W warnings in Tgetent and Tputs
Message-ID: <20010522233441.A12431@staff1.cso.uiuc.edu> p4raw-id: //depot/perl@10183
Diffstat (limited to 'lib/Term')
-rw-r--r--lib/Term/Cap.pm17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/Term/Cap.pm b/lib/Term/Cap.pm
index 6d31ab77c5..70376a65dd 100644
--- a/lib/Term/Cap.pm
+++ b/lib/Term/Cap.pm
@@ -1,9 +1,13 @@
package Term::Cap;
use Carp;
-our $VERSION = '1.00';
+our $VERSION = '1.01';
-# Last updated: Thu Nov 30 23:34:29 EST 2000 by schwern@pobox.com
+# 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
+# [PATCH] $VERSION crusade, strict, tests, etc... all over lib/
+# Version 1.01: Wed May 23 00:00:00 CST 2001 by d-lewart@uiuc.edu
+# Avoid warnings in Tgetent and Tputs
# TODO:
# support Berkeley DB termcaps
@@ -204,7 +208,7 @@ sub Tgetent { ## public -- static method
}
}
defined $entry or $entry = '';
- $entry .= $_;
+ $entry .= $_ if $_;
};
while ($state != 0) {
@@ -307,8 +311,11 @@ sub Tputs { ## public
$string = Tpad($self, $self->{'_' . $cap}, $cnt);
} else {
# cache result because Tpad can be slow
- $string = defined $self->{$cap} ? $self->{$cap} :
- ($self->{$cap} = Tpad($self, $self->{'_' . $cap}, 1));
+ unless (exists $self->{$cap}) {
+ $self->{$cap} = exists $self->{"_$cap"} ?
+ Tpad($self, $self->{"_$cap"}, 1) : undef;
+ }
+ $string = $self->{$cap};
}
print $FH $string if $FH;
$string;