From: Tim Peters Date: Wed, 18 Jan 2006 20:04:02 +0000 (+0000) Subject: Quote the path to the executable before invoking system(). X-Git-Tag: v2.5a0~799 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8207cc7fd69b2a74bab60d7a3735cd83394f3dbb;p=thirdparty%2FPython%2Fcpython.git Quote the path to the executable before invoking system(). --- diff --git a/PCbuild/make_buildinfo.c b/PCbuild/make_buildinfo.c index ca2db9f3abc9..798967a232f5 100644 --- a/PCbuild/make_buildinfo.c +++ b/PCbuild/make_buildinfo.c @@ -31,12 +31,13 @@ int make_buildinfo2() RegOpenKey(HKEY_CURRENT_USER, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS) /* Tortoise not installed */ return 0; - size = sizeof(command); - if (RegQueryValueEx(hTortoise, "Directory", 0, &type, command, &size) != ERROR_SUCCESS || + command[0] = '"'; /* quote the path to the executable */ + size = sizeof(command) - 1; + if (RegQueryValueEx(hTortoise, "Directory", 0, &type, command+1, &size) != ERROR_SUCCESS || type != REG_SZ) /* Registry corrupted */ return 0; - strcat(command, "bin\\subwcrev.exe"); + strcat(command, "bin\\subwcrev.exe\""); if (_stat(command, &st) < 0) /* subwcrev.exe not part of the release */ return 0;