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

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


The following commit(s) were added to refs/heads/master by this push:
     new f8289b2e29d tools: Update note about first line of a block
f8289b2e29d is described below

commit f8289b2e29d0bcf5f2c8557e908ee1fbe3656d1e
Author: Jiri Vlasak <[email protected]>
AuthorDate: Mon May 11 07:00:04 2026 +0200

    tools: Update note about first line of a block
    
    When checking the first line of a block, the returned value is
    incremented by one.
    
    This commit updates doc to explain why.
    
    Signed-off-by: Jiri Vlasak <[email protected]>
---
 tools/nxstyle.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/nxstyle.c b/tools/nxstyle.c
index d464dc3fb01..3d70d575c63 100644
--- a/tools/nxstyle.c
+++ b/tools/nxstyle.c
@@ -1036,7 +1036,13 @@ static int block_comment_width(char *line)
   if (strncmp(&line[b], "/***", 4) == 0 &&
       strncmp(&line[e - 2], "***", 3) == 0)
     {
-      /* Return the length of the line up to the final '*' */
+      /* Return the length of the line up to the final '*'.
+       *
+       * Please note, that here we lie. We return the length of the line plus
+       * one--the leading '/' plus the number of '*' plus 1. The reason is to
+       * fit the length of the last line of a block--the leading space ' '
+       * plus the number of '*' plus closing '/'.
+       */
 
       return e + 1;
     }

Reply via email to