File: 001-fix_columns_env_variable.patch

package info (click to toggle)
libcommandline-ruby 0.7.10-10
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 552 kB
  • ctags: 289
  • sloc: ruby: 2,881; makefile: 7
file content (19 lines) | stat: -rw-r--r-- 618 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- lib/commandline/application.rb.orig	2007-11-04 23:01:34.000000000 +0100
+++ lib/commandline/application.rb	2007-11-04 23:01:36.000000000 +0100
@@ -170,7 +170,6 @@
   def man
     require 'text/format'
     f = Text::Format.new
-    f = Text::Format.new
     f.columns = @columns
     f.first_indent  = 4
     f.body_indent   = @body_indent
@@ -335,7 +334,7 @@
     #
     # Formatting defaults
     #
-    console_width = ENV["COLUMNS"]
+    console_width = ENV["COLUMNS"].nil? ? nil : (Integer(ENV["COLUMNS"]) rescue ArgumentError nil)
     @columns = 
       if console_width.nil?
         DEFAULT_CONSOLE_WIDTH