diff options
Diffstat (limited to 'tools/man2html2.tcl')
-rw-r--r-- | tools/man2html2.tcl | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/tools/man2html2.tcl b/tools/man2html2.tcl index 399b54c..3e1344e 100644 --- a/tools/man2html2.tcl +++ b/tools/man2html2.tcl @@ -5,7 +5,7 @@ # # Copyright (c) 1996 by Sun Microsystems, Inc. # -# $Id: man2html2.tcl,v 1.5 2004/07/06 09:25:48 dkf Exp $ +# $Id: man2html2.tcl,v 1.6 2004/07/06 09:27:31 dkf Exp $ # # Global variables used by these scripts: @@ -519,27 +519,26 @@ proc setTabs {tabList} { set relative 0 } # Always operate in relative mode for "measurement" mode - if {[regexp {^\\w'.*'u$} $arg]} { - append tabString " 1" - set last [expr {$last + 2}] - continue - } - if {[scan $arg "%f%s" distance units] != 2} { - puts stderr "bad distance \"$arg\"" - return 0 - } - switch -- $units { - c { - set distance [expr {$distance * $charsPerInch / 2.54}] - } - i { - set distance [expr {$distance * $charsPerInch}] + if {[regexp {^\\w'(.*)'u$} $arg content]} { + set distance [string length $content] + } else { + if {[scan $arg "%f%s" distance units] != 2} { + puts stderr "bad distance \"$arg\"" + return 0 } - default { - puts stderr "bad units in distance \"$arg\"" - continue + switch -- $units { + c { + set distance [expr {$distance * $charsPerInch / 2.54}] + } + i { + set distance [expr {$distance * $charsPerInch}] + } + default { + puts stderr "bad units in distance \"$arg\"" + continue + } } - } + } # ? distance if {$relative} { append tabString [format "%*s1" [expr {round($distance-1)}] " "] |