[Python-checkins] r87205 - python/branches/py3k/PCbuild/make_buildinfo.c

kristjan.jonsson python-checkins at python.org
Mon Dec 13 04:32:10 CET 2010


Author: kristjan.jonsson
Date: Mon Dec 13 04:32:10 2010
New Revision: 87205

Log:
issue 10683
When the solution is converted to Visual Studio 2010, the command line to invoke make_buildinfo changes from:
$(SolutionDir)make_buildinfo.exe" Debug "$(IntDir)\"
to
$(SolutionDir)make_buildinfo.exe" Debug "$(IntDir)"
If the final backslash is omitted, the backslash in IntDir will escape the quote, thus passing the quote in as part of the path name.

This solution is a hack-fix to that problem by skipping any trailing quote from the path name.  It works as long as we don't need any additional arguments to make_buildinfo.exe.  This will help all those sould that are going to run this project through the visual studio autoconverter and get the same error.

Modified:
   python/branches/py3k/PCbuild/make_buildinfo.c

Modified: python/branches/py3k/PCbuild/make_buildinfo.c
==============================================================================
--- python/branches/py3k/PCbuild/make_buildinfo.c	(original)
+++ python/branches/py3k/PCbuild/make_buildinfo.c	Mon Dec 13 04:32:10 2010
@@ -91,6 +91,17 @@
     if (argc > 2) {
         tmpdir = argv[2];
         strcat_s(tmppath, _countof(tmppath), tmpdir);
+        /* Hack fix for bad command line:  If the command is issued like this:
+         * $(SolutionDir)make_buildinfo.exe" Debug "$(IntDir)"
+         * we will get a trailing quote because IntDir ends with a backslash that then
+         * escapes the final ".  To simplify the life for developers, catch that problem
+         * here by cutting it off.
+         * The proper command line, btw is:
+         * $(SolutionDir)make_buildinfo.exe" Debug "$(IntDir)\"
+         * Hooray for command line parsing on windows.
+         */
+        if (strlen(tmppath) > 0 && tmppath[strlen(tmppath)-1] == '"')
+            tmppath[strlen(tmppath)-1] = '\0';
         strcat_s(tmppath, _countof(tmppath), "\\");
     }
 


More information about the Python-checkins mailing list