summaryrefslogtreecommitdiff
path: root/src/control.c
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-03 19:03:11 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-03 19:03:11 +0200
commit20b85c03e751b4876fa3c92040464e483172b746 (patch)
tree734fadbfdbc143ec4465093857f4c239448715e0 /src/control.c
parenta6a7d6ce079cabdaf2fa502b2e2cf15e5428ac6f (diff)
manual format adjustment
Diffstat (limited to 'src/control.c')
-rw-r--r--src/control.c9
1 files changed, 5 insertions, 4 deletions
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;
}