1
0
Fork 0
forked from fun/fun

Some typo fixes reported by Clang. This is tested on Linux (Alpine and Artix) and FreeBSD.

This commit is contained in:
Johannes Findeisen 2025-09-17 13:02:00 +02:00
commit 2b043fbad0

View file

@ -85,7 +85,8 @@ static int starts_with_kw(const char *s, const char *kw) {
}
/* Compute how many indentation levels (2 spaces per level) are still open.
* Only counts significant lines (non-blank, not comment-only), and ignores text inside /* ... *\/ block comments. */
* Only counts significant lines (non-blank, not comment-only),
* and ignores text inside \/* ... *\/ block comments. */
static int compute_open_indent_blocks(const char *buf) {
int in_block_comment = 0;
int open = 0;
@ -131,7 +132,7 @@ static int compute_open_indent_blocks(const char *buf) {
/* // comment-only line */
continue;
} else if (t[1] == '*') {
/* /* start of block comment */
/* start of block comment */
in_block_comment = 1;
continue;
}
@ -157,8 +158,8 @@ static int compute_open_indent_blocks(const char *buf) {
}
/* Detect if current buffer looks incomplete:
* - Unclosed quotes (' or ") with escapes
* - Unclosed block comment /* ... *\/
* - Unclosed quotes (\' or \") with escapes
* - Unclosed block comment \/* ... *\/
* - Parentheses not balanced
* - Last significant line is a block header (if/else/while/for/fun)
* - Line ends with an operator/comma