mirror of
https://github.com/reactos/CMake.git
synced 2024-11-30 23:10:26 +00:00
VS: Adapt project parsers to support "ProjectGUID" without curly brackets
This is needed to correctly parse Windows Installer "wiproj" projects, that by default contain "ProjectGUID" tags with GUID values without surrounding curly brackets. Otherwise CMake truncates the first & last character from the GUID value for these projects.
This commit is contained in:
parent
c40d130034
commit
b3e6514c2a
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user