summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kconfiglib.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index d22ec75..5cb36b5 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -2943,7 +2943,10 @@ class Symbol(Item, _HasVisibility):
return ["# CONFIG_{0} is not set".format(self.name)]
elif self.type == STRING:
- return ['CONFIG_{0}="{1}"'.format(self.name, val)]
+ # Escape \ and "
+ return ['CONFIG_{0}="{1}"'
+ .format(self.name,
+ val.replace("\\", "\\\\").replace('"', '\\"'))]
elif self.type == INT or self.type == HEX:
return ["CONFIG_{0}={1}".format(self.name, val)]