From 0cbf8014ffc8af710ae96c2d3827ff2951d86b3a Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Wed, 26 Jun 2019 17:13:35 +1000 Subject: [PATCH] Correctly handle a last argument prefixed with : for any protocol message The previous handling for this had the : prefixing the last protocol argument reappear after a PasteArgs() call. This caused problems with the inspircd server, which prefixes the final argument for every protocol message with :. In particular the MODE command was problematic. See https://github.com/inspircd/inspircd/issues/1636 Reported-by: trn --- Changelog | 3 +++ source/parse.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index a4c24a3..62c8b0c 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,8 @@ [Changes 1.2.2] +* Correctly handle a last argument prefixed with : for any protocol message, + for compatibility with inspircd. Reported by trn. (caf) + * Fix SHOW_AWAY_ONCE so it shows away message if the nick has changed. (caf) * Handle 301 numeric with missing message argument. Reported by trn. (caf) diff --git a/source/parse.c b/source/parse.c index 75f05a0..2d785e3 100644 --- a/source/parse.c +++ b/source/parse.c @@ -366,7 +366,9 @@ int BX_BreakArgs(char *Input, char **Sender, char **OutPut, int ig_sender) if (*Input == ':') { - OutPut[ArgCount++] = ++Input; + /* Squash the : so if PasteArgs() is called it doesn't reappear */ + ov_strcpy(Input, Input + 1); + OutPut[ArgCount++] = Input; break; }