From 20b85c03e751b4876fa3c92040464e483172b746 Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Wed, 3 Jul 2024 19:03:11 +0200 Subject: manual format adjustment --- src/control.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/control.c') diff --git a/src/control.c b/src/control.c index a40030d..d595c0f 100644 --- a/src/control.c +++ b/src/control.c @@ -11,6 +11,7 @@ #include "scan.h" #include "stralloc.h" + static char inbuf[2048]; static stralloc line = {0}; static stralloc me = {0}; @@ -21,13 +22,14 @@ static int meok = 0; static void striptrailingwhitespace(stralloc *sa) { - while (sa->len > 0) switch (sa->s[sa->len - 1]) - { + while (sa->len > 0) { + switch (sa->s[sa->len - 1]) { case '\n': case ' ': case '\t': --sa->len; break; default: return; } + } } int control_init(void) @@ -45,8 +47,7 @@ int control_rldef(stralloc *sa, char *fn, int flagme, char *def) r = control_readline(sa, fn); if (r) return r; - if (flagme) - if (meok) return stralloc_copy(sa, &me) ? 1 : -1; + if (flagme && meok) return stralloc_copy(sa, &me) ? 1 : -1; if (def) return stralloc_copys(sa, def) ? 1 : -1; return r; } -- cgit v1.2.3