1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 14:56:39 +02:00

core: fix execution of empty command name

The strings "/" and "/ " are not considered as valid commands any more.
This commit is contained in:
Sébastien Helleu
2015-12-31 19:07:14 +01:00
parent 295158d3e1
commit 57b6e320d3
3 changed files with 31 additions and 3 deletions
+15 -1
View File
@@ -1214,11 +1214,25 @@ TEST(String, Input)
/* string_input_for_buffer */
POINTERS_EQUAL(NULL, string_input_for_buffer (NULL));
POINTERS_EQUAL(NULL, string_input_for_buffer ("/"));
POINTERS_EQUAL(NULL, string_input_for_buffer ("/abc"));
str = strdup ("");
STRCMP_EQUAL(str, string_input_for_buffer (str));
free (str);
str = strdup ("/");
STRCMP_EQUAL(str, string_input_for_buffer (str));
free (str);
str = strdup ("/ ");
STRCMP_EQUAL(str, string_input_for_buffer (str));
free (str);
str = strdup ("/ abc");
STRCMP_EQUAL(str, string_input_for_buffer (str));
free (str);
str = strdup ("/ /");
STRCMP_EQUAL(str, string_input_for_buffer (str));
free (str);
str = strdup ("/*");
STRCMP_EQUAL(str, string_input_for_buffer (str));
free (str);
str = strdup ("abc");
STRCMP_EQUAL(str, string_input_for_buffer (str));
free (str);