Quote the path to the executable before invoking system().
authorTim Peters <tim.peters@gmail.com>
Wed, 18 Jan 2006 20:04:02 +0000 (20:04 +0000)
committerTim Peters <tim.peters@gmail.com>
Wed, 18 Jan 2006 20:04:02 +0000 (20:04 +0000)
PCbuild/make_buildinfo.c

index ca2db9f3abc963d724e3857ae706ecd6a7bf6c0b..798967a232f51cc1b5c739bc6a90ac2e991bc353 100644 (file)
@@ -31,12 +31,13 @@ int make_buildinfo2()
            RegOpenKey(HKEY_CURRENT_USER, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS)\r
                /* Tortoise not installed */\r
                return 0;\r
-       size = sizeof(command);\r
-       if (RegQueryValueEx(hTortoise, "Directory", 0, &type,  command, &size) != ERROR_SUCCESS ||\r
+       command[0] = '"';  /* quote the path to the executable */\r
+       size = sizeof(command) - 1;\r
+       if (RegQueryValueEx(hTortoise, "Directory", 0, &type, command+1, &size) != ERROR_SUCCESS ||\r
            type != REG_SZ)\r
                /* Registry corrupted */\r
                return 0;\r
-       strcat(command, "bin\\subwcrev.exe");\r
+       strcat(command, "bin\\subwcrev.exe\"");\r
        if (_stat(command, &st) < 0)\r
                /* subwcrev.exe not part of the release */\r
                return 0;\r