about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-09-13 15:11:05 -0400
committerJune McEnroe <june@causal.agency>2018-09-13 15:11:05 -0400
commit311795bf412012ae42c0a4e4ba0afc55517f2bc8 (patch)
tree5eb287139a30574e2ae38318618a0baaddcfe6e5
parentFix weird tab-complete after comma (diff)
downloadcatgirl-311795bf412012ae42c0a4e4ba0afc55517f2bc8.tar.gz
catgirl-311795bf412012ae42c0a4e4ba0afc55517f2bc8.zip
Return a format->split even at the end of the string
-rw-r--r--format.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/format.c b/format.c
index 30b287e..b9cd8b1 100644
--- a/format.c
+++ b/format.c
@@ -66,7 +66,13 @@ static const wchar_t Stops[] = {
 
 bool formatParse(struct Format *format, const wchar_t *split) {
 	format->str += format->len;
-	if (!format->str[0]) return false;
+	if (!format->str[0]) {
+		if (split == format->str && !format->split) {
+			format->split = true;
+			return true;
+		}
+		return false;
+	}
 
 	const wchar_t *init = format->str;
 	switch (format->str[0]) {