Skip to content

Commit de5265a

Browse files
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 061e71f commit de5265a

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
@@ -2612,7 +2612,7 @@ def _parse_assignment(self, s):
26122612
else:
26132613
break
26142614

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

0 commit comments

Comments
 (0)