core: fix detection of command in input: a single command char is considered as a command (API function "string_input_for_bufer")

v2.8-utf8proc
Nils Görs 2012-12-25 10:54:51 +01:00 committed by Sebastien Helleu
parent cf76379aa9
commit 67a111f7f2
2 changed files with 9 additions and 4 deletions

View File

@ -1,12 +1,14 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.4.0-dev, 2012-12-24
v0.4.0-dev, 2012-12-25
Version 0.4.0 (under dev!)
--------------------------
* core: fix detection of command in input: a single command char is considered
as a command (API function "string_input_for_bufer")
* core: search for a fallback template when a no template is matching command
arguments
* core: add option "diff" for command /set (list options with changed value)

View File

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