summaryrefslogtreecommitdiffstats
path: root/cfg.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-06-19 21:20:27 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-06-19 21:20:27 +0000
commit85135221f08d2e2d54269c8b8fc4325833c2fe9d (patch)
tree60fc49fda53deff487ce4f2a3db6f4a6ad0d9ef0 /cfg.c
parent0695db3889928969d4281859bbe676d7c8605f49 (diff)
Handle commented lines.
Diffstat (limited to 'cfg.c')
-rw-r--r--cfg.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/cfg.c b/cfg.c
index 7bb4b488..be55c51d 100644
--- a/cfg.c
+++ b/cfg.c
@@ -1,4 +1,4 @@
-/* $Id: cfg.c,v 1.10 2008-06-19 21:13:56 nicm Exp $ */
+/* $Id: cfg.c,v 1.11 2008-06-19 21:20:24 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -78,17 +78,11 @@ load_cfg(const char *path, char **cause)
}
n++;
- /* Trim spaces from start and end. */
- while (*buf != '\0' && (*buf == ' ' || *buf == '\t'))
- *buf++ = '\0';
- len = strlen(buf);
- while (len > 0 && (buf[len - 1] == ' ' || buf[len - 1] == '\t'))
- buf[--len] = '\0';
- if (*buf == '\0')
- continue;
-
- if ((cmd = cmd_string_parse(buf, cause)) == NULL)
+ if ((cmd = cmd_string_parse(buf, cause)) == NULL) {
+ if (*cause == NULL)
+ continue;
goto error;
+ }
cfg_cause = NULL;
ctx.msgdata = NULL;