[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser-bundle/master] Bug #10472: Pass arguments to the browser from Linux startup script.



commit b712a8c8e9374e13e913f42aa105af76ae06ddf2
Author: Mike Perry <mikeperry-git@xxxxxxxxxxxxxx>
Date:   Thu Feb 27 16:34:40 2014 -0800

    Bug #10472: Pass arguments to the browser from Linux startup script.
    
    Patch by gacar.
---
 RelativeLink/RelativeLink.sh |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/RelativeLink/RelativeLink.sh b/RelativeLink/RelativeLink.sh
index 4a10c58..9bab08c 100755
--- a/RelativeLink/RelativeLink.sh
+++ b/RelativeLink/RelativeLink.sh
@@ -118,10 +118,12 @@ fi
 
 debug=0
 usage_message="usage: $0 [--debug]"
-if [ "$#" -eq 1 -a \( "x$1" = "x--debug" -o "x$1" = "x-debug" \) ]; then
+# !!! We may have more than one argument, changed -eq to -ge in if & elif clauses below
+if [ "$#" -ge 1 -a \( "x$1" = "x--debug" -o "x$1" = "x-debug" \) ]; then
 	debug=1
+	shift # pop the debug argument
 	printf "\nDebug enabled.\n\n"
-elif [ "$#" -eq 1 -a \( "x$1" = "x--help" -o "x$1" = "x-help" \) ]; then
+elif [ "$#" -ge 1 -a \( "x$1" = "x--help" -o "x$1" = "x-help" \) ]; then
 	echo "$usage_message"
 	exit 0
 fi
@@ -216,7 +218,9 @@ printf "\nLaunching Tor Browser Bundle for Linux in ${HOME}\n"
 cd "${HOME}"
 # XXX Someday we should pass whatever command-line arguments we got
 # (probably filenames or URLs) to Firefox.
-./Browser/firefox -no-remote -profile Data/Browser/profile.default
+# !!! Dash above comment! Now we pass command-line arguments we got (except --debug) to Firefox.
+# !!! Use at your own risk!
+./Browser/firefox -no-remote -profile Data/Browser/profile.default ${@}
 exitcode="$?"
 if [ "$exitcode" -ne 0 ]; then
 	complain "Tor Browser exited abnormally.  Exit code: $exitcode"

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits