Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Handle escaped backslash at end of string

manongjohn6ea45db0df67
diff --git a/toonz/sources/common/tstream/tstream.cpp b/toonz/sources/common/tstream/tstream.cpp
index b56e55885..7eb57fbda 100644
--- a/toonz/sources/common/tstream/tstream.cpp
+++ b/toonz/sources/common/tstream/tstream.cpp
@@ -1074,15 +1074,15 @@ TIStream &TIStream::operator>>(TFilePath &v) {
is.get(c);
if (c == '"') {
is.get(c);
- bool escapedChar = false;
+ bool escapeChar = false;
// If processing double-quote ("), if it's escaped, keep reading.
- while (is && (c != '"' || escapedChar)) {
+ while (is && (c != '"' || escapeChar)) {
// if(c=='\\')
// is.get(c);
- if (c == '\\')
- escapedChar = true;
+ if (c == '\\' && !escapeChar)
+ escapeChar = true;
else
- escapedChar = false;
+ escapeChar = false;
s.append(1, c);
is.get(c);
}