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
This commit is contained in:
Kevin Easton 2019-06-26 17:13:35 +10:00
parent 8d4808d744
commit 0cbf8014ff
2 changed files with 6 additions and 1 deletions

View File

@ -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)

View File

@ -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;
}