files: avoid an abortion when excuting a command in a new buffer
The key sequence ^R ^X M-F <Enter> would cause nano to abort, because it would try to add an empty string to a history list. (Furthermore, simply don't execute an empty command, because it is pointless.) Reported-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
Этот коммит содержится в:
родитель
42497f77e2
Коммит
84c650b80a
@ -1127,11 +1127,14 @@ void do_insertfile(void)
|
||||
if (ISSET(MULTIBUFFER))
|
||||
open_buffer("", FALSE);
|
||||
#endif
|
||||
/* Save the command's output in the current buffer. */
|
||||
execute_command(answer);
|
||||
/* If the command is not empty, execute it and read its output
|
||||
* into the buffer, and add the command to the history list. */
|
||||
if (*answer != '\0') {
|
||||
execute_command(answer);
|
||||
#ifndef DISABLE_HISTORIES
|
||||
update_history(&execute_history, answer);
|
||||
update_history(&execute_history, answer);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
/* If this is a new buffer, put the cursor at the top. */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user