issue 10501

make_buildinfo regression with unquoted path
Make_buildinfo.exe should be called with a quoted path, and should quote the full paths to its temp files, to support spaces in filenames.
parent b87ef8f8
...@@ -52,9 +52,9 @@ int make_buildinfo2(const char *tmppath) ...@@ -52,9 +52,9 @@ int make_buildinfo2(const char *tmppath)
if (_stat(command+1, &st) < 0) if (_stat(command+1, &st) < 0)
/* subwcrev.exe not part of the release */ /* subwcrev.exe not part of the release */
return 0; return 0;
strcat_s(command, CMD_SIZE, "\" .. ..\\Modules\\getbuildinfo.c "); strcat_s(command, CMD_SIZE, "\" .. ..\\Modules\\getbuildinfo.c \"");
strcat_s(command, CMD_SIZE, tmppath); strcat_s(command, CMD_SIZE, tmppath); /* quoted tmppath */
strcat_s(command, CMD_SIZE, "getbuildinfo2.c"); strcat_s(command, CMD_SIZE, "getbuildinfo2.c\"");
puts(command); fflush(stdout); puts(command); fflush(stdout);
if (system(command) < 0) if (system(command) < 0)
return 0; return 0;
...@@ -95,19 +95,21 @@ int main(int argc, char*argv[]) ...@@ -95,19 +95,21 @@ int main(int argc, char*argv[])
} }
if ((do_unlink = make_buildinfo2(tmppath))) { if ((do_unlink = make_buildinfo2(tmppath))) {
strcat_s(command, CMD_SIZE, "\"");
strcat_s(command, CMD_SIZE, tmppath); strcat_s(command, CMD_SIZE, tmppath);
strcat_s(command, CMD_SIZE, "getbuildinfo2.c -DSUBWCREV "); strcat_s(command, CMD_SIZE, "getbuildinfo2.c\" -DSUBWCREV ");
} else } else
strcat_s(command, CMD_SIZE, "..\\Modules\\getbuildinfo.c"); strcat_s(command, CMD_SIZE, "..\\Modules\\getbuildinfo.c");
strcat_s(command, CMD_SIZE, " -Fo"); strcat_s(command, CMD_SIZE, " -Fo\"");
strcat_s(command, CMD_SIZE, tmppath); strcat_s(command, CMD_SIZE, tmppath);
strcat_s(command, CMD_SIZE, "getbuildinfo.o -I..\\Include -I..\\PC"); strcat_s(command, CMD_SIZE, "getbuildinfo.o\" -I..\\Include -I..\\PC");
puts(command); fflush(stdout); puts(command); fflush(stdout);
result = system(command); result = system(command);
if (do_unlink) { if (do_unlink) {
command[0] = '\0'; command[0] = '\0';
strcat_s(command, CMD_SIZE, "\"");
strcat_s(command, CMD_SIZE, tmppath); strcat_s(command, CMD_SIZE, tmppath);
strcat_s(command, CMD_SIZE, "getbuildinfo2.c"); strcat_s(command, CMD_SIZE, "getbuildinfo2.c\"");
_unlink(command); _unlink(command);
} }
if (result < 0) if (result < 0)
......
...@@ -59,11 +59,11 @@ ...@@ -59,11 +59,11 @@
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
Description="Generate build information..." Description="Generate build information..."
CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)" CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release &quot;$(IntDir)\&quot;"
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="$(IntDir)\getbuildinfo.o" AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName).dll" OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc" IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb" ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
...@@ -134,11 +134,11 @@ ...@@ -134,11 +134,11 @@
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
Description="Generate build information..." Description="Generate build information..."
CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)" CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release &quot;$(IntDir)\&quot;"
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="$(IntDir)\getbuildinfo.o" AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName).dll" OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc" IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb" ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
...@@ -212,11 +212,11 @@ ...@@ -212,11 +212,11 @@
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
Description="Generate build information..." Description="Generate build information..."
CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug $(IntDir)" CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug &quot;$(IntDir)\&quot;"
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="$(IntDir)\getbuildinfo.o" AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName)_d.dll" OutputFile="$(OutDir)\$(PyDllName)_d.dll"
IgnoreDefaultLibraryNames="libc" IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName)_d.pdb" ProgramDatabaseFile="$(OutDir)$(PyDllName)_d.pdb"
...@@ -290,11 +290,11 @@ ...@@ -290,11 +290,11 @@
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
Description="Generate build information..." Description="Generate build information..."
CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug $(IntDir)" CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Debug &quot;$(IntDir)\&quot;"
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="$(IntDir)\getbuildinfo.o" AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName)_d.dll" OutputFile="$(OutDir)\$(PyDllName)_d.dll"
IgnoreDefaultLibraryNames="libc" IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName)_d.pdb" ProgramDatabaseFile="$(OutDir)$(PyDllName)_d.pdb"
...@@ -364,11 +364,11 @@ ...@@ -364,11 +364,11 @@
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
Description="Generate build information..." Description="Generate build information..."
CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)" CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release &quot;$(IntDir)\&quot;"
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="$(IntDir)\getbuildinfo.o" AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName).dll" OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc" IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb" ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
...@@ -439,11 +439,11 @@ ...@@ -439,11 +439,11 @@
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
Description="Generate build information..." Description="Generate build information..."
CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)" CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release &quot;$(IntDir)\&quot;"
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="$(IntDir)\getbuildinfo.o" AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName).dll" OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc" IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb" ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
...@@ -514,11 +514,11 @@ ...@@ -514,11 +514,11 @@
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
Description="Generate build information..." Description="Generate build information..."
CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release ($IntDir)" CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release &quot;$(IntDir)\&quot;"
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="$(IntDir)\getbuildinfo.o" AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName).dll" OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc" IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb" ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
...@@ -589,11 +589,11 @@ ...@@ -589,11 +589,11 @@
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
Description="Generate build information..." Description="Generate build information..."
CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release $(IntDir)" CommandLine="&quot;$(SolutionDir)make_buildinfo.exe&quot; Release &quot;$(IntDir)\&quot;"
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="$(IntDir)\getbuildinfo.o" AdditionalDependencies="&quot;$(IntDir)getbuildinfo.o&quot;"
OutputFile="$(OutDir)\$(PyDllName).dll" OutputFile="$(OutDir)\$(PyDllName).dll"
IgnoreDefaultLibraryNames="libc" IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb" ProgramDatabaseFile="$(OutDir)$(PyDllName).pdb"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment