summaryrefslogtreecommitdiff
path: root/kconfiglib.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2012-12-18 12:57:28 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2012-12-18 12:57:28 +0100
commitda92656c46268f2aabfebef26399297de17d2a18 (patch)
tree0d4c0d2044d4fbb2b018b7b7c8436b0ded769ac8 /kconfiglib.py
parent60c48adcfb64ae14205bf4686cf96a219b703835 (diff)
Properly unescape .config string assignments.
Diffstat (limited to 'kconfiglib.py')
-rw-r--r--kconfiglib.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index f05fa59..86fe9c1 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -300,7 +300,10 @@ class Config():
set_re_match = set_re.match(line)
if set_re_match:
name, val = set_re_match.groups()
- val = _strip_quotes(val, line, filename, linenr)
+ # The unescaping producedure below should be safe since " can
+ # only appear as \" inside the string
+ val = _strip_quotes(val, line, filename, linenr)\
+ .replace('\\"', '"').replace("\\\\", "\\")
if name in self.syms:
sym = self.syms[name]