This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 21c5ba161a8b02afd0f6c32c26c10c2a66c63f04
Author: Old-Ding <[email protected]>
AuthorDate: Mon Jul 6 04:48:26 2026 +0800

    tools: kconfig2html: Handle blank input lines
    
    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 <[email protected]>
---
 tools/kconfig2html.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/kconfig2html.c b/tools/kconfig2html.c
index 9c973718a29..1ec003ef505 100644
--- a/tools/kconfig2html.c
+++ b/tools/kconfig2html.c
@@ -702,6 +702,12 @@ static char *read_line(FILE *stream)
           g_line[len] = '\0';
         }
 
+      if (len == 0)
+        {
+          g_lnptr = g_line;
+          return g_line;
+        }
+
       /* Does this continue on the next line?  Note that this check
        * could erroneoulsy combine two lines if a comment line ends with
        * a line continuation... Don't do that!

Reply via email to