From c3b910928f34306f34ee6a9c3c13debbf8ff67f4 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Wed, 25 Aug 2010 02:03:53 +0200 Subject: [PATCH] Fixed config parsing bug. --- lib/cf.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/cf.c b/lib/cf.c index d0b1207..3314e4a 100644 --- a/lib/cf.c +++ b/lib/cf.c @@ -93,11 +93,13 @@ static int parsefile(struct cfstate *s, FILE *in) line[0] = 0; } s->lno++; - for(p = line + strlen(line) - 1; p >= line; p--) { - if(isspace(*p)) - *p = 0; - else - break; + if(line[0]) { + for(p = line + strlen(line) - 1; p >= line; p--) { + if(isspace(*p)) + *p = 0; + else + break; + } } for(ind = 0, p = line; *p; p++) { if(*p == ' ') { -- 2.11.0