tools: kconfig2html: Handle blank input lines#19322
Open
Old-Ding wants to merge 2 commits into
Open
Conversation
Old-Ding
requested review from
jerpelea,
simbit18 and
xiaoxiang781216
as code owners
July 5, 2026 20:49
|
xiaoxiang781216
approved these changes
Jul 6, 2026
Contributor
|
I think you should try running the tool to make sure that your change does what you want |
Old-Ding
force-pushed
the
codex/kconfig2html-blank-line
branch
from
July 8, 2026 03:38
bdb2d9d to
68a72dc
Compare
xiaoxiang781216
approved these changes
Jul 8, 2026
read_line() removes a trailing newline and then checks g_line[len - 1] for a line-continuation backslash. A blank line leaves len at zero, so the continuation check reads before g_line. Return the empty line to the caller before checking for a continuation. kconfig_line() already skips empty lines, so parser behavior is unchanged. Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
Old-Ding
force-pushed
the
codex/kconfig2html-blank-line
branch
from
July 8, 2026 13:57
68a72dc to
c4d0fb4
Compare
xiaoxiang781216
previously approved these changes
Jul 9, 2026
acassis
requested changes
Jul 17, 2026
Contributor
|
Can you also edit the description to follow the PR template? |
Explain why the guard runs before checking for a continuation marker. Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
xiaoxiang781216
approved these changes
Jul 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: Please adhere to Contributing Guidelines.
Summary
read_line()removes a trailing newline and then checksg_line[len - 1]for a line-continuation backslash. A blank input line leaveslenat zero, so the continuation check would read beforeg_line.Return the empty line to the caller before checking for a continuation.
kconfig_line()already skips empty lines, so parser behavior for non-empty Kconfig entries stays unchanged.Impact
No configuration syntax, generated output, or hardware behavior changes. Blank Kconfig lines are now handled safely instead of reaching the continuation-marker access with an empty buffer.
Testing
tools/kconfig2html.cwith GCC 16.1.0 (winlibs).kconfig2html; it exited successfully and generated a 4,177-byte HTML file.git diff --checkpassed.Unrecognized garbage after default valueparser limitation, outside the changedread_line()blank-line path; no hardware testing applies to this host tool change.