diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-12-29 22:32:38 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-12-29 22:32:38 +0100 |
commit | 1b851a5778196a34affe397e4c502b326afd3270 (patch) | |
tree | be694149670179d84ef77b36ef21a56d9c7048a7 /src | |
parent | 3d24a8847e156804e19515ddeefd3912402515be (diff) | |
download | blogc-1b851a5778196a34affe397e4c502b326afd3270.tar.gz blogc-1b851a5778196a34affe397e4c502b326afd3270.tar.bz2 blogc-1b851a5778196a34affe397e4c502b326afd3270.zip |
loader: parse tags as space-separated string
Diffstat (limited to 'src')
-rw-r--r-- | src/loader.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/loader.c b/src/loader.c index 8f04dae..5cd24df 100644 --- a/src/loader.c +++ b/src/loader.c @@ -141,11 +141,14 @@ blogc_source_parse_from_files(b_trie_t *conf, b_slist_t *l, blogc_error_t **err) b_trie_free(s); continue; } - char **tags = b_str_split(tags_str, ',', 0); + char **tags = b_str_split(tags_str, ' ', 0); bool found = false; - for (unsigned int i = 0; tags[i] != NULL; i++) - if (0 == strcmp(b_str_strip(tags[i]), filter_tag)) + for (unsigned int i = 0; tags[i] != NULL; i++) { + if (tags[i][0] == '\0') + continue; + if (0 == strcmp(tags[i], filter_tag)) found = true; + } b_strv_free(tags); if (!found) { b_trie_free(s); |