]> git.hungrycats.org Git - linux/commit
kconfig: fix infinite loop when expanding a macro at the end of file
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 2 Feb 2024 15:57:59 +0000 (00:57 +0900)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:18:51 +0000 (18:18 -0400)
commit240a6bba1e396c76d90ba5bcb9b45e45f2ca0f64
treee7bd7d91319ab7d8f1a919aeba8a3b34e0b6c73b
parent1c3e40e85d9390d257a984cca5fc23f9426ef520
kconfig: fix infinite loop when expanding a macro at the end of file

[ Upstream commit af8bbce92044dc58e4cc039ab94ee5d470a621f5 ]

A macro placed at the end of a file with no newline causes an infinite
loop.

[Test Kconfig]
  $(info,hello)
  \ No newline at end of file

I realized that flex-provided input() returns 0 instead of EOF when it
reaches the end of a file.

Fixes: 104daea149c4 ("kconfig: reference environment variables directly and remove 'option env='")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/kconfig/lexer.l