fix fmt-c while without body

This commit is contained in:
2025-10-22 18:20:12 +03:00
committed by Pavel Kulyov
parent 55a0235a37
commit 1b721b34a0

View File

@@ -607,9 +607,11 @@
(define (c-while check . body)
(c-reset-newline
(cat (c-block (cat "while (" (c-in-test (c-expr check)) ")")
(c-in-stmt (apply c-begin body)))
fl)))
(if (null? body)
(cat "while (" (c-in-test (c-expr check)) ");")
(cat (c-block (cat "while (" (c-in-test (c-expr check)) ")")
(c-in-stmt (apply c-begin body)))
fl))))
(define (c-for init check update . body)
(c-reset-newline