summaryrefslogtreecommitdiffstats
path: root/idfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'idfile.c')
-rw-r--r--idfile.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/idfile.c b/idfile.c
index 4979c85..15e8019 100644
--- a/idfile.c
+++ b/idfile.c
@@ -63,16 +63,18 @@ init_idfile (char const *id_file, struct idhead *idh, struct idarg **id_args)
strings = malloc (i = idh->idh_tokens_offset - idh->idh_args_offset);
fread (strings, i, 1, id_FILE);
ida = *id_args = CALLOC (struct idarg, idh->idh_paths);
- for (i = 0; i < idh->idh_args; i++)
+ for (i = 0; i < idh->idh_paths; i++)
{
- if (*strings != '+' && *strings != '-')
+ while (*strings == '+' || *strings == '-')
{
- ida->ida_flags = 0;
- ida->ida_arg = strings;
- ida->ida_next = ida + 1;
- ida->ida_index = i;
- ida++;
+ while (*strings++)
+ ;
}
+ ida->ida_flags = 0;
+ ida->ida_arg = strings;
+ ida->ida_next = ida + 1;
+ ida->ida_index = i;
+ ida++;
while (*strings++)
;
}