Commit Diff


commit - 9d7a2e6e3c1ae32728214346ee014c493bddb347
commit + 0156f05f498d4685dba5dcc815d3092b8c38be01
blob - 0aafb76a652e28aa1f3bf13cc63e46279ce22be4
blob + cfc0ab9e2be2d1c0108b6af9c764275afd6ad9bc
--- bin/web
+++ bin/web
@@ -52,28 +52,23 @@ plumbapple()
 
 plumbunix()
 {
-	case ${BROWSER:-firefox} in
+	case "${BROWSER:=firefox}" in
 	# Other browsers here
 	# ...
 	*opera*)
-		$BROWSER -remote 'openURL('$i',new-page)'
+		$BROWSER -remote 'openURL('"$i"',new-page)'
 		;;
 	*firebird*)
-		$BROWSER -remote 'openURL('$i',new-window)'
+		$BROWSER -remote 'openURL('"$i"',new-window)'
 		;;
 	*firefox*)
-		$BROWSER -remote 'openURL('$i',new-tab)'
+		$BROWSER -remote 'openURL('"$i"',new-tab)' ||
+		$BROWSER "$i"
 		;;
-	x-)
-		BROWSER=firefox
-		$BROWSER -remote 'openURL('$i',new-tab)'
-		;;
 	*mozilla*)
-		$BROWSER -remote 'openURL('$i',new-tab)'
+		$BROWSER -remote 'openURL('"$i"',new-tab)' ||
+		$BROWSER "$i"
 		;;
-	x-*)
-		$BROWSER -remote 'openURL('$i',new-tab)'
-		;;
 	esac
 }
 
@@ -99,8 +94,11 @@ else
 		if [ -f "$i" ]
 		then
 			p=`pwd`
+			i=`echo $i | sed 's/ /%20/g'`
 			i=`cleanname -d $p $i`
 			i=file://$i
+		else
+			i=`echo $i | tr -d ' '`
 		fi
 		plumb1 $i
 	done