diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2010-11-22 11:37:06 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2010-11-22 11:37:06 (GMT) |
commit | 60fafa276cefc677839927a0647c8bda3703be0b (patch) | |
tree | c5844cbea99ab6947485301df745aa32645cc520 /PCbuild/make_buildinfo.c | |
parent | b87ef8f872b6c0df20f69579a68dfac6c2cf4eb2 (diff) | |
download | cpython-60fafa276cefc677839927a0647c8bda3703be0b.zip cpython-60fafa276cefc677839927a0647c8bda3703be0b.tar.gz cpython-60fafa276cefc677839927a0647c8bda3703be0b.tar.bz2 |
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.
Diffstat (limited to 'PCbuild/make_buildinfo.c')
-rw-r--r-- | PCbuild/make_buildinfo.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/PCbuild/make_buildinfo.c b/PCbuild/make_buildinfo.c index a41aac5..94ca8c0 100644 --- a/PCbuild/make_buildinfo.c +++ b/PCbuild/make_buildinfo.c @@ -52,9 +52,9 @@ int make_buildinfo2(const char *tmppath) if (_stat(command+1, &st) < 0) /* subwcrev.exe not part of the release */ return 0; - strcat_s(command, CMD_SIZE, "\" .. ..\\Modules\\getbuildinfo.c "); - strcat_s(command, CMD_SIZE, tmppath); - strcat_s(command, CMD_SIZE, "getbuildinfo2.c"); + strcat_s(command, CMD_SIZE, "\" .. ..\\Modules\\getbuildinfo.c \""); + strcat_s(command, CMD_SIZE, tmppath); /* quoted tmppath */ + strcat_s(command, CMD_SIZE, "getbuildinfo2.c\""); puts(command); fflush(stdout); if (system(command) < 0) return 0; @@ -95,19 +95,21 @@ int main(int argc, char*argv[]) } if ((do_unlink = make_buildinfo2(tmppath))) { + strcat_s(command, CMD_SIZE, "\""); strcat_s(command, CMD_SIZE, tmppath); - strcat_s(command, CMD_SIZE, "getbuildinfo2.c -DSUBWCREV "); + strcat_s(command, CMD_SIZE, "getbuildinfo2.c\" -DSUBWCREV "); } else 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, "getbuildinfo.o -I..\\Include -I..\\PC"); + strcat_s(command, CMD_SIZE, "getbuildinfo.o\" -I..\\Include -I..\\PC"); puts(command); fflush(stdout); result = system(command); if (do_unlink) { command[0] = '\0'; + strcat_s(command, CMD_SIZE, "\""); strcat_s(command, CMD_SIZE, tmppath); - strcat_s(command, CMD_SIZE, "getbuildinfo2.c"); + strcat_s(command, CMD_SIZE, "getbuildinfo2.c\""); _unlink(command); } if (result < 0) |