summaryrefslogtreecommitdiff
path: root/src/control.c
diff options
context:
space:
mode:
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;
}