diff --git a/src/mdiary.c b/src/mdiary.c index 6028bc2..3a17e50 100644 --- a/src/mdiary.c +++ b/src/mdiary.c @@ -191,7 +191,7 @@ static GList *mdiary_add_tags_from_string(gchar *string) */ ptr = beg_ptr = orig_ptr = g_strdup(g_match_info_fetch(match_info, 1)); do { - if (*ptr == ',' || *ptr == ' ' || *ptr == '\0') { + if (*ptr == ',' || *ptr == '\0') { bak = *ptr; if (collected) { collected = 0; @@ -202,6 +202,9 @@ static GList *mdiary_add_tags_from_string(gchar *string) } else { beg_ptr = ptr + 1; } + } else if (*ptr == ' ') { + if (!collected) + beg_ptr = ptr + 1; } else { collected = 1; }