script/lsec
branchstable-1.3
changeset 1760 036f19bde00b
parent 1751 b6cfd85db58e
--- a/script/lsec	Thu Oct 02 08:08:26 2008 +0000
+++ b/script/lsec	Thu Oct 02 09:56:39 2008 +0000
@@ -213,15 +213,20 @@
 
 sub get_terminal_width
 {
-    my $winsize;
-    die "no TIOCGWINSZ " unless defined &TIOCGWINSZ;
-    open(TTY, "+</dev/tty") or die "No tty: $!";
-    unless (ioctl(TTY, &TIOCGWINSZ, $winsize='')) {
-        die sprintf "$0: ioctl TIOCGWINSZ (%08x: $!)\n", &TIOCGWINSZ;
-    }
-    (my $row, my $col, my $xpixel, my $ypixel) = unpack('S4', $winsize);
+    my $col = 50;
+
+    if (defined &TIOCGWINSZ) {
+        my $winsize;
+        open(TTY, "+</dev/tty") or die "No tty: $!";
+        unless (ioctl(TTY, &TIOCGWINSZ, $winsize='')) {
+            die sprintf "$0: ioctl TIOCGWINSZ (%08x: $!)\n", &TIOCGWINSZ;
+        }
+        (my $row, $col, my $xpixel, my $ypixel) = unpack('S4', $winsize);
+    }
+
     return $col;
 }
+
 #------------------------------------------------------------------------------
 
 sub print_line