Package: libterm-readkey-perl
Version: 2.32-1+b1
Severity: normal
Tags: patch, upstream

Hi,

there seems to be a bug in GetTerminalSize using the optional filehandle
parameter. The man page reads:

    GetTerminalSize [Filehandle]

But the implementation ignores the first parameter and expects the filehandle
as second parameter:

    sub GetTerminalSize
    {
        my ($file) = normalizehandle( ( @_ > 1 ? $_[1] : \*STDOUT ) );


So it seems to be a off-by-one error, I've attached a trival patch.


HTH,
Thomas


-- System Information:
Debian Release: 8.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.3.3-tl1+ (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)

Versions of packages libterm-readkey-perl depends on:
ii  libc6                       2.19-18+deb8u4
ii  perl                        5.20.2-3+deb8u4
ii  perl-base [perlapi-5.20.0]  5.20.2-3+deb8u4

libterm-readkey-perl recommends no packages.

libterm-readkey-perl suggests no packages.

-- no debconf information
--- /usr/lib/x86_64-linux-gnu/perl5/5.20/Term/ReadKey.pm	2014-03-03 19:23:04.000000000 +0100
+++ ReadKey.pm-params	2016-05-17 16:56:53.151701359 +0200
@@ -350,7 +350,7 @@
 
 sub GetTerminalSize
 {
-    my ($file) = normalizehandle( ( @_ > 1 ? $_[1] : \*STDOUT ) );
+    my ($file) = normalizehandle( ( @_ > 0 ? $_[0] : \*STDOUT ) );
     my (@results) = ();
     my (@fail);
 

Reply via email to