diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index db1776ac29..5e81514d4f 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -17,7 +17,12 @@ public: virtual void CharacterDataHandler(const char* data, int length) { if (this->DoGUID) { - this->GUID.assign(data + 1, length - 2); + if (data[0] == '{') { + // remove surrounding curly brackets + this->GUID.assign(data + 1, length - 2); + } else { + this->GUID.assign(data, length); + } this->DoGUID = false; } } diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index a1771ee132..afd71c813c 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -2079,7 +2079,10 @@ public: if (strcmp(atts[i], "ProjectGUID") == 0) { if (atts[i + 1]) { this->GUID = atts[i + 1]; - this->GUID = this->GUID.substr(1, this->GUID.size() - 2); + if (this->GUID[0] == '{') { + // remove surrounding curly brackets + this->GUID = this->GUID.substr(1, this->GUID.size() - 2); + } } else { this->GUID.clear(); }