[lldb/SWIG] Add missing '\' in macros again

Making the string conversion operator a macro unintentionally dropped
the backslash before '\n' and '\r' and was therefore incorrectly
stripping 'n' and 'r' from the object description.
This commit is contained in:
Jonas Devlieghere 2020-01-09 08:13:25 -08:00
parent ea9888b8f6
commit 93a1e9c90c

View File

@ -6,7 +6,7 @@
$self->GetDescription (stream, Level);
const char *desc = stream.GetData();
size_t desc_len = stream.GetSize();
if (desc_len > 0 && (desc[desc_len-1] == 'n' || desc[desc_len-1] == 'r')) {
if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) {
--desc_len;
}
return std::string(desc, desc_len);
@ -23,7 +23,7 @@
$self->GetDescription (stream);
const char *desc = stream.GetData();
size_t desc_len = stream.GetSize();
if (desc_len > 0 && (desc[desc_len-1] == 'n' || desc[desc_len-1] == 'r')) {
if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) {
--desc_len;
}
return std::string(desc, desc_len);