Control: found 855334 1:45.8.0-1
Control: tags 855334 + patch

Passing multiple arguments to Thunderbird is still a problem in 45.8.0-1
except that the failures are silent now :/

On Sun 2017-03-12 12:00:53 -0400, Guido Günther wrote:

> FWIW git-pbuilder has code to mangle options to pass them on to
> pbuilder (which is a very similar problem) and uses a shell array. You
> can rip out the code from there.

cool, thanks for the pointer!

I note that git-pbuilder is also a bash script, and it has a
shell_quote() function which looks much more complex than just using the
builtin printf's %q expansion, and git-pbuilder is also trying to mix
explicitly-set external variables with internally-generated variables,
which is more complex than what /usr/bin/thunderbird needs.

I think the simplest thing is to just replace the declaration,
accumulation, and use entirely with array usage, and leave it at that.

I've included a patch here that appears to do the right thing for me.

Regards,

        --dkg

diff --git a/thunderbird b/thunderbird
index 28983ca..8d57976 100755
--- a/thunderbird
+++ b/thunderbird
@@ -45,7 +45,7 @@ export VERBOSE=0
 # set MOZ_APP_LAUNCHER for gnome-session
 export MOZ_APP_LAUNCHER
 
-TB_ARGS=""
+declare -a TB_ARGS=()
 while [ $# -gt 0 ]; do
     ARG="$1"
     case ${ARG} in
@@ -76,7 +76,7 @@ while [ $# -gt 0 ]; do
             exit 1
             ;;
         # every other argument is needed to get down to the TB starting call
-        *) TB_ARGS="${TB_ARGS} ${ARG}"
+        *) TB_ARGS+=("${ARG}")
         ;;
     esac
     shift
@@ -228,8 +228,8 @@ fi
 # If we are here we going simply further by starting Thunderbird.
 
 if [ "${DEBUG}" = "" ]; then
-    output_debug "call '$MOZ_LIBDIR/$MOZ_APP_NAME ${TB_ARGS}'"
-    $MOZ_LIBDIR/$MOZ_APP_NAME "${TB_ARGS}"
+    output_debug "call '$MOZ_LIBDIR/$MOZ_APP_NAME ${TB_ARGS[*]}'"
+    $MOZ_LIBDIR/$MOZ_APP_NAME "${TB_ARGS[@]}"
 else
     # User has selected GDB?
     if [ "$DEBUGGER" = "1" ]; then
@@ -237,7 +237,7 @@ else
         if [ -f /usr/bin/gdb ]; then
             if [ -f /usr/lib/debug/usr/lib/thunderbird/thunderbird ]; then
                 output_info "Starting Thunderbird with GDB ..."
-                LANG='' /usr/lib/thunderbird/run-mozilla.sh -g /usr/lib/thunderbird/thunderbird-bin "${TB_ARGS}"
+                LANG='' /usr/lib/thunderbird/run-mozilla.sh -g /usr/lib/thunderbird/thunderbird-bin "${TB_ARGS[@]}"
             else
                 output_info "No package 'thunderbird-dbg' installed! Please install first and restart."
                 exit 1

Attachment: signature.asc
Description: PGP signature

Reply via email to