From 6edee75884b327f5956670c1f3afc92395c79553 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Thu, 13 Dec 2012 13:57:06 +0100 Subject: Fix loading of .config files with empty assignments. "CONFIG_FOO=" was broken because _strip_quotes() could not handle empty strings. --- kconfiglib.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kconfiglib.py b/kconfiglib.py index 025e6cc..59373f0 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -3598,6 +3598,8 @@ def _strip_quotes(s, line, filename, linenr): """Removes any quotes surrounding 's' if it has them; otherwise returns 's' unmodified.""" s = s.strip() + if not s: + return s if s[0] == '"' or s[0] == "'": if len(s) < 2 or s[-1] != s[0]: _parse_error(line, -- cgit v1.2.3