diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-12-29 01:46:50 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-12-29 01:46:50 +0100 |
commit | 3d24a8847e156804e19515ddeefd3912402515be (patch) | |
tree | 01c79d43b529df75211b991c74f35c2782a177ff /src | |
parent | e727bdcde63804a308103adeaa2637c5ee1ebdc8 (diff) | |
download | blogc-3d24a8847e156804e19515ddeefd3912402515be.tar.gz blogc-3d24a8847e156804e19515ddeefd3912402515be.tar.bz2 blogc-3d24a8847e156804e19515ddeefd3912402515be.zip |
renderer: foreach variables should be splitted in spaces rather than commas
Diffstat (limited to 'src')
-rw-r--r-- | src/renderer.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/renderer.c b/src/renderer.c index 6cf924e..defbe10 100644 --- a/src/renderer.c +++ b/src/renderer.c @@ -97,10 +97,14 @@ blogc_split_list_variable(const char *name, b_trie_t *global, b_trie_t *local) b_slist_t *rv = NULL; - char **tmp = b_str_split(value, ',', 0); - for (unsigned int i = 0; tmp[i] != NULL; i++) - rv = b_slist_append(rv, b_strdup(b_str_strip(tmp[i]))); - b_strv_free(tmp); + char **tmp = b_str_split(value, ' ', 0); + for (unsigned int i = 0; tmp[i] != NULL; i++) { + if (tmp[i][0] != '\0') // ignore empty strings + rv = b_slist_append(rv, tmp[i]); + else + free(tmp[i]); + } + free(tmp); return rv; } |