]> granicus.if.org Git - python/commitdiff
Issue #21907: Avoid using double quotes to check argument values.
authorZachary Ware <zachary.ware@gmail.com>
Fri, 1 Aug 2014 04:58:27 +0000 (23:58 -0500)
committerZachary Ware <zachary.ware@gmail.com>
Fri, 1 Aug 2014 04:58:27 +0000 (23:58 -0500)
Double quotes in expanded variables can match literal double quotes,
which makes for a big mess when passing in a quoted argument (like
"/p:externalsDir=..\externals", for example).

PCbuild/build.bat

index cde88c5a7ad5b8da71e9c84bd65a259993dac9c7..838f6ef7632646e41a2c7bfcd63de097bfedd530 100644 (file)
@@ -16,13 +16,13 @@ set target=Build
 set dir=%~dp0
 
 :CheckOpts
-if "%1"=="-c" (set conf=%2) & shift & shift & goto CheckOpts
-if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts
-if "%1"=="-r" (set target=Rebuild) & shift & goto CheckOpts
-if "%1"=="-d" (set conf=Debug) & shift & goto CheckOpts
-if "%1"=="-e" call "%dir%get_externals.bat" & shift & goto CheckOpts
+if '%1'=='-c' (set conf=%2) & shift & shift & goto CheckOpts
+if '%1'=='-p' (set platf=%2) & shift & shift & goto CheckOpts
+if '%1'=='-r' (set target=Rebuild) & shift & goto CheckOpts
+if '%1'=='-d' (set conf=Debug) & shift & goto CheckOpts
+if '%1'=='-e' call "%dir%get_externals.bat" & shift & goto CheckOpts
 
-if "%platf%"=="x64" (set vs_platf=x86_amd64)
+if '%platf%'=='x64' (set vs_platf=x86_amd64)
 
 rem Setup the environment
 call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" %vs_platf%