From: Andy Spencer Date: Thu, 25 Dec 2014 00:31:25 +0000 (+0000) Subject: Support multiple wildcard matches X-Git-Url: http://pileus.org/git/?p=lackey;a=commitdiff_plain;h=df25782353e65760843f8e188ecb4b7c6fc5dbc7 Support multiple wildcard matches --- diff --git a/cals/ical.c b/cals/ical.c index 981d08d..52ffc50 100644 --- a/cals/ical.c +++ b/cals/ical.c @@ -152,17 +152,16 @@ static void read_icals(void) if (cal->comp == NULL && cal->location) { wordexp_t wexp; wordexp(cal->location, &wexp, WRDE_NOCMD); - if (wexp.we_wordc == 0) - continue; - FILE *file = fopen(wexp.we_wordv[0], "r"); - wordfree(&wexp); - if (!file) - continue; - icalparser *parser = icalparser_new(); - icalparser_set_gen_data(parser, file); + for (int i = 0; i < wexp.we_wordc; i++) { + FILE *file = fopen(wexp.we_wordv[i], "r"); + if (!file) + continue; + icalparser_set_gen_data(parser, file); + } cal->comp = icalparser_parse(parser, (void*)fgets); icalparser_free(parser); + wordfree(&wexp); } } }