From 3ee9a5a07e4c2bfb475631de2937c63f584523bf Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Mon, 17 Dec 2012 20:01:19 +0100 Subject: Tighten up string literal parsing a bit more. --- kconfiglib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kconfiglib.py b/kconfiglib.py index ee6f20d..d22ec75 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -696,12 +696,12 @@ class Config(): append(sym) elif c == '"' or c == "'": - quote = c i += 1 if "\\" in s: # Slow path: This could probably be sped up, but it's a # very unusual case anyway. + quote = c value = "" while 1: if i >= strlen: @@ -722,7 +722,7 @@ class Config(): else: # Fast path: If the string contains no backslashes (almost # always) we can simply look for the matching quote. - end = s.find(quote, i) + end = s.find(c, i) if end == -1: _tokenization_error(s, strlen, filename, linenr) append(s[i:end]) -- cgit v1.2.3