diff --git a/builtin.cpp b/builtin.cpp index 6b0fb3217..861d355dc 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -471,10 +471,10 @@ static int builtin_bind_add(const wchar_t *seq, const wchar_t *cmd, int terminfo if (terminfo) { - const wchar_t *seq2 = input_terminfo_get_sequence(seq); - if (seq2) + wcstring seq2; + if (input_terminfo_get_sequence(seq, &seq2)) { - input_mapping_add(seq2, cmd); + input_mapping_add(seq2.c_str(), cmd); } else { diff --git a/input.cpp b/input.cpp index e23a1b7ac..eddcc545f 100644 --- a/input.cpp +++ b/input.cpp @@ -241,17 +241,14 @@ static void input_terminfo_init(); Returns the function description for the given function code. */ -void input_mapping_add(const wchar_t *sequence, - const wchar_t *command) +void input_mapping_add(const wchar_t *sequence, const wchar_t *command) { - size_t i; CHECK(sequence,); CHECK(command,); // debug( 0, L"Add mapping from %ls to %ls", escape(sequence, 1), escape(command, 1 ) ); - - for (i=0; i