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. /* 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) { static int compute_open_indent_blocks(const char *buf) {
int in_block_comment = 0; int in_block_comment = 0;
int open = 0; int open = 0;
@ -131,7 +132,7 @@ static int compute_open_indent_blocks(const char *buf) {
/* // comment-only line */ /* // comment-only line */
continue; continue;
} else if (t[1] == '*') { } else if (t[1] == '*') {
/* /* start of block comment */ /* start of block comment */
in_block_comment = 1; in_block_comment = 1;
continue; continue;
} }
@ -157,8 +158,8 @@ static int compute_open_indent_blocks(const char *buf) {
} }
/* Detect if current buffer looks incomplete: /* Detect if current buffer looks incomplete:
* - Unclosed quotes (' or ") with escapes * - Unclosed quotes (\' or \") with escapes
* - Unclosed block comment /* ... *\/ * - Unclosed block comment \/* ... *\/
* - Parentheses not balanced * - Parentheses not balanced
* - Last significant line is a block header (if/else/while/for/fun) * - Last significant line is a block header (if/else/while/for/fun)
* - Line ends with an operator/comma * - Line ends with an operator/comma