# HG changeset patch
# User Florian Pose <fp@igh-essen.com>
# Date 1222941399 0
# Node ID 036f19bde00bdde03a44a68258e3a7aa0f662e90
# Parent  c3b4d3a50ac66e8a613215e908187bc0e288e47f
Fixed lsec for terminals that do not support getting the terminal width.

diff -r c3b4d3a50ac6 -r 036f19bde00b Makefile.am
--- a/Makefile.am	Thu Oct 02 08:08:26 2008 +0000
+++ b/Makefile.am	Thu Oct 02 09:56:39 2008 +0000
@@ -59,7 +59,7 @@
 		svnversion $(srcdir) 2>/dev/null >$(distdir)/svnrevision; \
 	fi
 	if which svn2cl >/dev/null 2>&1; then \
-        svn2cl svn://yak/vol/projekte/msr_messen_steuern_regeln/ethercat/rep; \
+        svn2cl svn://svn/vol/projekte/msr_messen_steuern_regeln/ethercat/rep; \
     fi
 
 mrproper: clean cleandoc
diff -r c3b4d3a50ac6 -r 036f19bde00b script/lsec
--- 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