| summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/tool/strings.c')
| -rw-r--r-- | src/tool/strings.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/tool/strings.c b/src/tool/strings.c index 9fe13f6..73a5cdd 100644 --- a/src/tool/strings.c +++ b/src/tool/strings.c @@ -224,6 +224,26 @@ int ZoO_strings_parse w_start = i; + if (input[i] == '\001') + { + /* This is an CTCP command. */ + /* We'll remove the trailing '\001' so that only the first word */ + /* indicates the need for CTCP (uppercase) syntax. */ + + if ((input_size >= 1) && (input[input_size - 1] == '\001')) + { + input[input_size - 1] = ' '; + } + else + { + ZoO_WARNING + ( + "CTCP sequence '%s' did not end with a \\001 character.", + input + ); + } + } + for (; i < input_size; ++i) { if (input[i] == ' ') @@ -265,7 +285,7 @@ int ZoO_strings_parse s, punctuations_count, punctuations, - /* overflow-safe: w_start < i */ + /* overflow-safe: w_start =< i */ (i - w_start), (input + w_start) ) < 0 |


