Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8d28a92

Browse files
author
Kristján Valur Jónsson
committed
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.
1 parent 3c54ea6 commit 8d28a92

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

PCbuild/make_buildinfo.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ int main(int argc, char*argv[])
9191
if (argc > 2) {
9292
tmpdir = argv[2];
9393
strcat_s(tmppath, _countof(tmppath), tmpdir);
94+
/* Hack fix for bad command line: If the command is issued like this:
95+
* $(SolutionDir)make_buildinfo.exe" Debug "$(IntDir)"
96+
* we will get a trailing quote because IntDir ends with a backslash that then
97+
* escapes the final ". To simplify the life for developers, catch that problem
98+
* here by cutting it off.
99+
* The proper command line, btw is:
100+
* $(SolutionDir)make_buildinfo.exe" Debug "$(IntDir)\"
101+
* Hooray for command line parsing on windows.
102+
*/
103+
if (strlen(tmppath) > 0 && tmppath[strlen(tmppath)-1] == '"')
104+
tmppath[strlen(tmppath)-1] = '\0';
94105
strcat_s(tmppath, _countof(tmppath), "\\");
95106
}
96107

0 commit comments

Comments
 (0)