1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-01 06:16:44 +02:00

fix buggy path autocomplete behaviour

This commit is contained in:
Jfreegman
2014-07-28 01:33:12 -04:00
parent b18a67d656
commit 94a8ce5aa8
3 changed files with 15 additions and 19 deletions

View File

@ -756,10 +756,9 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr)
if (key == '\t' && ctx->len > 1 && ctx->line[0] == '/') { /* TAB key: auto-complete */
int diff = -1;
int sf_len = 11;
if (wcsncmp(ctx->line, L"/sendfile \"", sf_len) == 0) {
diff = dir_match(self, m, &ctx->line[sf_len]);
if (wcsncmp(ctx->line, L"/sendfile \"", wcslen(L"/sendfile \"")) == 0) {
diff = dir_match(self, m, ctx->line);
} else {
diff = complete_line(self, chat_cmd_list, AC_NUM_CHAT_COMMANDS, MAX_CMDNAME_SIZE);
}