diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2012-12-17 20:01:19 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2012-12-17 20:01:19 +0100 |
| commit | 3ee9a5a07e4c2bfb475631de2937c63f584523bf (patch) | |
| tree | 040c1d5f82112e2b235403a7193af7bc5c25f9ea | |
| parent | b6f62d6f7db1e16b42bf0e5e3c6f5a0d1a3b04df (diff) | |
Tighten up string literal parsing a bit more.
| -rw-r--r-- | kconfiglib.py | 4 |
1 files 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]) |
