diff options
author | Daniel S. Lewart <lewart@uiuc.edu> | 2001-05-22 18:34:41 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-05-23 21:27:54 +0000 |
commit | a33d46fef29f83d02baa4cada9d6017e58c56c19 (patch) | |
tree | 823aa7868bed8ebda380fd022e1bff1dbeb70a49 /lib | |
parent | c5a91703d5ad1aeab126755a2845ae62050ec8e3 (diff) | |
download | perl-a33d46fef29f83d02baa4cada9d6017e58c56c19.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')
-rw-r--r-- | lib/Term/Cap.pm | 17 |
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; |