Fixes support of file names starting or ending with a space.

This commit is contained in:
Andrea Mazzoleni 2011-05-24 21:03:30 +02:00
parent 58f191ef1f
commit 35f3c092ed
8 changed files with 65 additions and 23 deletions

14
state.c
View file

@ -99,9 +99,12 @@ void state_config(struct snapraid_state* state, const char* path, int verbose, i
/* start */
s = buffer;
s = strskip(s);
/* ignore commens and empty lines */
/* skip initial spaces */
while (*s && isspace(*s))
++s;
/* ignore comments and empty lines */
if (*s == '#' || *s == 0)
continue;
@ -261,9 +264,12 @@ void state_read(struct snapraid_state* state)
/* start */
s = buffer;
s = strskip(s);
/* ignore commens and empty lines */
/* skip initial spaces */
while (*s && isspace(*s))
++s;
/* ignore comments and empty lines */
if (*s == '#' || *s == 0)
continue;