diff options
| author | Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de> | 2024-08-26 12:19:20 +0200 |
|---|---|---|
| committer | Torsten Tejlmand Rasmussen <torsten.rasmussen@nordicsemi.no> | 2025-10-21 15:57:55 +0200 |
| commit | c3f78659b886f81b7b5898497c9aa94dc634aef2 (patch) | |
| tree | 4adf9ba918f12a5dd90a1ccdb9b2554600973956 | |
| parent | 407b92b8e35601d1f4a2a2925996bf4d61b2f5cd (diff) | |
kconfiglib: check empty strings on macro expansion
During macro expansion, bare macros on a line are accepted by the parser
as long as they resolve to blank strings. The problem is that the script
is currently checking using isspace, so it's actually not checking for
blank strings.
This causes the parsing to fail when a macro is the last line of a file,
and no newline character is added afterwards. This patch adds a check for
the string itself being empty.
| -rw-r--r-- | kconfiglib.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index 77f35e4..4506296 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2611,7 +2611,7 @@ class Kconfig(object): else: break - if s.isspace(): + if not s or s.isspace(): # We also accept a bare macro on a line (e.g. # $(warning-if,$(foo),ops)), provided it expands to a blank string return |
