Skip to content

Commit c3f7865

Browse files
leandrolanzieritejlmand
authored andcommitted
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.
1 parent 407b92b commit c3f7865

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kconfiglib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2611,7 +2611,7 @@ def _parse_assignment(self, s):
26112611
else:
26122612
break
26132613

2614-
if s.isspace():
2614+
if not s or s.isspace():
26152615
# We also accept a bare macro on a line (e.g.
26162616
# $(warning-if,$(foo),ops)), provided it expands to a blank string
26172617
return

0 commit comments

Comments
 (0)