Bug 1491999: Quote command line for multiple components. r=mhowell, a=jcristau FENNEC_62_0_2_BUILD1 FENNEC_62_0_2_RELEASE FIREFOX_62_0_2_BUILD1 FIREFOX_62_0_2_RELEASE
authorAdam Gashlin <agashlin@mozilla.com>
Tue, 18 Sep 2018 16:08:09 +0000
changeset 481148 150c70d39363b57ea4e92fbbd900b338f09177d6
parent 481147 df0865bc3084808922212f58a932f8fda04ddc5b
child 481149 294655cb0a68771328f8901221c55bd190537b4a
push id1788
push userjcristau@mozilla.com
push dateThu, 20 Sep 2018 13:12:37 +0000
treeherdermozilla-release@150c70d39363 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhowell, jcristau
bugs1491999
milestone62.0.2
Bug 1491999: Quote command line for multiple components. r=mhowell, a=jcristau The macro expansion of ExecAndWaitForInputIdle consumes the quotes around the macro argument. The argument has an extra layer of quotes around the executable name, which keeps it together even if it has spaces, but we need yet another layer around the whole command line or else each component of the command line appears as another argument to StrCpy. Standard practice is to quote args in the macro definition, I overlooked this in the initial implementation. Differential Revision: https://phabricator.services.mozilla.com/D6111
toolkit/mozapps/installer/windows/nsis/common.nsh
--- a/toolkit/mozapps/installer/windows/nsis/common.nsh
+++ b/toolkit/mozapps/installer/windows/nsis/common.nsh
@@ -8127,17 +8127,17 @@
 !define CREATE_DEFAULT_ERROR_MODE 0x04000000
 !macro ExecAndWaitForInputIdle_ CMDLINE
   ; derived from https://stackoverflow.com/a/13960786/3444805 by Anders Kjersem
   Push $0
   Push $1
   Push $2
 
   ; Command line
-  StrCpy $0 ${CMDLINE}
+  StrCpy $0 "${CMDLINE}"
 
   ; STARTUPINFO
   System::Alloc 68
   Pop $1
   ; fill in STARTUPINFO.cb (first field) with sizeof(STARTUPINFO)
   System::Call "*$1(i 68)"
 
   ; PROCESS_INFORMATION