summary refs log tree commit diff
path: root/format.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--format.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/format.c b/format.c
index 800388b..30b287e 100644
--- a/format.c
+++ b/format.c
@@ -64,10 +64,11 @@ static const wchar_t Stops[] = {
 	L'\0',
 };
 
-bool formatParse(struct Format *format, const wchar_t *stop) {
+bool formatParse(struct Format *format, const wchar_t *split) {
 	format->str += format->len;
 	if (!format->str[0]) return false;
 
+	const wchar_t *init = format->str;
 	switch (format->str[0]) {
 		break; case IRCBold:      format->str++; format->bold ^= true;
 		break; case IRCItalic:    format->str++; format->italic ^= true;
@@ -76,14 +77,15 @@ bool formatParse(struct Format *format, const wchar_t *stop) {
 		break; case IRCColor:     format->str++; parseColor(format);
 		break; case IRCReset:     format->str++; formatReset(format);
 	}
+	format->split = (split >= init && split <= format->str);
 
 	if (format->str[0] == L' ') {
 		format->len = 1 + wcscspn(&format->str[1], Stops);
 	} else {
 		format->len = wcscspn(format->str, Stops);
 	}
-	if (stop && stop > format->str && stop < &format->str[format->len]) {
-		format->len = stop - format->str;
+	if (split > format->str && split < &format->str[format->len]) {
+		format->len = split - format->str;
 	}
 	return true;
 }
> 2021-09-16Fix /* **/ comment matchingJune McEnroe 2021-09-15Remove typer, add downgrade to READMEJune McEnroe 2021-09-15Set bot mode on downgradeJune McEnroe 2021-09-15Enter capsicum in downgradeJune McEnroe 2021-09-15Factor out common parts of downgrade messagesJune McEnroe 2021-09-14Add downgrade IRC botJune McEnroe 2021-09-14Sort by title if authors matchJune McEnroe 2021-09-13Swap-remove tags as they're foundJune McEnroe 2021-09-12Replace htagml regex with strncmpJune McEnroe 2021-09-11Also defer printing comment for lone close-parensJune McEnroe 2021-09-10Publish "git-comment"June McEnroe 2021-09-10Add git comment --pretty optionJune McEnroe 2021-09-08Defer printing comment if line is blank or closing braceJune McEnroe 2021-09-08Up default min-repeat to 30 linesJune McEnroe 2021-09-08Handle dirty lines in git-commentJune McEnroe 2021-09-08Document and install git-commentJune McEnroe 2021-09-08Add repeat and all options to git-commentJune McEnroe 2021-09-08Add group threshold to git-commentJune McEnroe