diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2012-12-13 13:57:06 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2012-12-13 13:57:06 +0100 |
| commit | 6edee75884b327f5956670c1f3afc92395c79553 (patch) | |
| tree | 00903e45c678f978d9415265a3eeaba634451770 | |
| parent | 6e444f548b88313609c655df14bb1c72c3e98dc8 (diff) | |
Fix loading of .config files with empty assignments.
"CONFIG_FOO=" was broken because _strip_quotes() could not handle empty
strings.
| -rw-r--r-- | kconfiglib.py | 2 |
1 files changed, 2 insertions, 0 deletions
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, |
