diff options
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/config.c b/src/config.c index daf6474..8a2b5c8 100644 --- a/src/config.c +++ b/src/config.c @@ -200,18 +200,19 @@ void config_load(struct tofi *tofi, const char *filename) copy_pos++; } { - char *line_stripped = strip(line); - if (!line_stripped) { - /* Skip blank lines */ - continue; + /* Grab first non-space character on the line. */ + char c; + for (char *tmp = line; *tmp != '\0'; tmp++) { + c = *tmp; + if (!isspace(c)) { + break; + } } - char first_char = line_stripped[0]; - free(line_stripped); /* * Comment characters. * N.B. treating section headers as comments for now. */ - switch (first_char) { + switch (c) { case '#': case ';': case '[': |