mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 23:06:38 +02:00
core: fix detection of command in input: a single command char is considered as a command (API function "string_input_for_bufer")
This commit is contained in:
committed by
Sebastien Helleu
parent
cf76379aa9
commit
67a111f7f2
@@ -1989,7 +1989,7 @@ string_input_for_buffer (const char *string)
|
||||
pos_space = strchr (string + 1, ' ');
|
||||
|
||||
/*
|
||||
* if there's no other '/' of if '/' is after first space,
|
||||
* if there's no other '/' or if '/' is after first space,
|
||||
* then it is a command, and return NULL
|
||||
*/
|
||||
if (!pos_slash || (pos_space && pos_slash > pos_space))
|
||||
@@ -2002,10 +2002,13 @@ string_input_for_buffer (const char *string)
|
||||
if (!string_is_command_char (string))
|
||||
return string;
|
||||
|
||||
/* check if first char is doubled: if yes, then it's not a command */
|
||||
next_char = utf8_next_char (string);
|
||||
|
||||
/* there's no next char, then it's a command */
|
||||
if (!next_char || !next_char[0])
|
||||
return string;
|
||||
return NULL;
|
||||
|
||||
/* check if first char is doubled: if yes, then it's not a command */
|
||||
if (utf8_charcmp (string, next_char) == 0)
|
||||
return next_char;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user