File: 003-hman-browser.patch

package info (click to toggle)
man2html 1.6f%2Brepack-1%2Bsqueeze1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,416 kB
  • ctags: 2,894
  • sloc: ansic: 9,558; sh: 2,301; makefile: 343; perl: 335; awk: 305; lisp: 171; cs: 170
file content (91 lines) | stat: -rw-r--r-- 2,504 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Rename BROWSER variable to HMAN_BROWSER in the hman.sh script 
to avoid conflict with sensible-browser's BROWSER.

diff -ruN man-1.6c-old/man2html/hman.sh man-1.6c/man2html/hman.sh
--- man-1.6c-old/man2html/hman.sh	2004-07-27 22:46:29.000000000 +0200
+++ man-1.6c/man2html/hman.sh	2004-07-27 22:47:06.000000000 +0200
@@ -17,26 +17,26 @@
 # hman from %version%
 #
 
-if [ x"$1" = x"-v" -o x"$1" = x"-V" ]; then
+if [ x"$1" = x"-v" ] || [ x"$1" = x"-V" ]; then
 	echo "`basename $0` from %version%"
 	exit 0
 fi
 
 # The user has to set MANHTMLPAGER (or he will get httpd-free lynx).
 # Pick your favorite browser: lynx, xmosaic, netscape, arena, amaya, grail, ...
-BROWSER=${MANHTMLPAGER-lynxcgi}
+HMAN_BROWSER=${MANHTMLPAGER-lynxcgi}
 #
 # If the man pages are on a remote host, specify it in MANHTMLHOST.
 HOST=${MANHTMLHOST-localhost}
 
 # Perhaps the browser was specified on the command line?
-if [ $# -gt 1 -a "$1" = "-P" ]; then
-    BROWSER="$2"
+if [ "$#" -gt 1 ] && [ x"$1" = x"-P" ]; then
+    HMAN_BROWSER="$2"
     shift; shift
 fi
 
 # Perhaps the host was specified on the command line?
-if [ $# -gt 1 -a "$1" = "-H" ]; then
+if [ "$#" -gt 1 ] && [ x"$1" = x"-H" ]; then
     HOST="$2"
     shift; shift
 fi
@@ -54,13 +54,13 @@
 	fi
 }
 
-case $BROWSER in
+case "$HMAN_BROWSER" in
      lynxcgi)
-	BROWSER=lynx
+	HMAN_BROWSER=lynx
 	CG="lynxcgi:/home/httpd/cgi-bin/man"
 	;;
      netscape)
-        BROWSER=nsfunc
+        HMAN_BROWSER=nsfunc
         CG="http://$HOST/cgi-bin/man"
 	;;
      *)
@@ -68,26 +68,26 @@
 	;;
 esac
 
-  case $# in
-     0)   $BROWSER $CG/man2html ;;
+  case "$#" in
+     0)   $HMAN_BROWSER "$CG/man2html" ;;
      1)   case "$1" in
 	    1|2|3|4|5|6|7|8|l|n)
-		$BROWSER "$CG/mansec?$CG+$1" ;;
+		$HMAN_BROWSER "$CG/mansec?$CG+$1" ;;
 	    /*)
-		$BROWSER "$CG/man2html?$1" ;;
+		$HMAN_BROWSER "$CG/man2html?$1" ;;
 	    */*)
-		$BROWSER "$CG/man2html?$PWD/$1" ;;
+		$HMAN_BROWSER "$CG/man2html?$PWD/$1" ;;
 	    *)
-		$BROWSER "$CG/man2html?$1" ;;
+		$HMAN_BROWSER "$CG/man2html?$1" ;;
           esac ;;
      2)   case "$1" in
             -k)
-                $BROWSER "$CG/mansearch?$2" ;;
+                $HMAN_BROWSER "$CG/mansearch?$2" ;;
             *)
 		if [ "$2" = index ]; then
-		    $BROWSER "$CG/manwhatis?$CG+$1"
+		    $HMAN_BROWSER "$CG/manwhatis?$CG+$1"
                 else
-		    $BROWSER "$CG/man2html?$1+$2"
+		    $HMAN_BROWSER "$CG/man2html?$1+$2"
                 fi ;;
           esac ;;
      *)   echo "bad number of args" ;;