Commit: 1b9de4fa3379cd74cb138c2f78960ce9831daf66
Author: Jacques Lucke
Date:   Tue Oct 6 13:35:12 2020 +0200
Branches: master
https://developer.blender.org/rB1b9de4fa3379cd74cb138c2f78960ce9831daf66

BLI: escape double quotes in dot export

===================================================================

M       source/blender/blenlib/intern/dot_export.cc

===================================================================

diff --git a/source/blender/blenlib/intern/dot_export.cc 
b/source/blender/blenlib/intern/dot_export.cc
index 9ffb1895d04..eb15a51366e 100644
--- a/source/blender/blenlib/intern/dot_export.cc
+++ b/source/blender/blenlib/intern/dot_export.cc
@@ -225,7 +225,15 @@ void Attributes::export__as_bracket_list(std::stringstream 
&ss) const
       ss << key << "=" << value << ", ";
     }
     else {
-      ss << key << "=\"" << value << "\", ";
+      ss << key << "=\"";
+      for (char c : value) {
+        if (c == '\"') {
+          /* Escape double quotes. */
+          ss << '\\';
+        }
+        ss << c;
+      }
+      ss << "\", ";
     }
   });
   ss << "]";

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to