diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-19 21:20:27 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-19 21:20:27 +0000 |
commit | 85135221f08d2e2d54269c8b8fc4325833c2fe9d (patch) | |
tree | 60fc49fda53deff487ce4f2a3db6f4a6ad0d9ef0 /cfg.c | |
parent | 0695db3889928969d4281859bbe676d7c8605f49 (diff) |
Handle commented lines.
Diffstat (limited to 'cfg.c')
-rw-r--r-- | cfg.c | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -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; |