- files.c:do_insertfile() - Handle cancel from ExtCmd properly (David Benbennick)

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1154 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2002-03-29 15:06:05 +00:00
parent 465a0ffa15
commit e373909037
2 changed files with 16 additions and 10 deletions

View File

@ -13,6 +13,8 @@ CVS code -
- Stat full_path, not path (Steven Kneizys). - Stat full_path, not path (Steven Kneizys).
open_pipe() open_pipe()
- I18nize the pipe error (DLR). - I18nize the pipe error (DLR).
do_insertfile()
- Handle cancel from ExtCmd properly (David Benbennick).
read_file() read_file()
- Abort if we read a file of 0 lines (num_lines == 0), fixes BUG #70. - Abort if we read a file of 0 lines (num_lines == 0), fixes BUG #70.
- Reverse tests to stop segfault on editing a new file of 0 - Reverse tests to stop segfault on editing a new file of 0

22
files.c
View File

@ -472,6 +472,19 @@ int do_insertfile(int loading_file)
} }
#endif #endif
#ifndef NANO_SMALL
if (i == NANO_EXTCMD_KEY) {
int ts;
ts = statusq(1, extcmd_list, "", _("Command to execute "));
if (ts == -1 || answer == NULL || !strcmp(answer,"")) {
statusbar(_("Cancelled"));
UNSET(KEEP_CUTBUFFER);
display_main_list();
return 0;
}
}
#endif
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
if (loading_file) { if (loading_file) {
@ -485,17 +498,8 @@ int do_insertfile(int loading_file)
#ifndef NANO_SMALL #ifndef NANO_SMALL
if (i == NANO_EXTCMD_KEY) { if (i == NANO_EXTCMD_KEY) {
i = statusq(1, extcmd_list, "", _("Command to execute "));
if (i == -1) {
statusbar(_("Cancelled"));
UNSET(KEEP_CUTBUFFER);
display_main_list();
return 0;
}
if (answer != NULL) {
i = open_pipe(answer); i = open_pipe(answer);
} }
}
else else
#endif /* NANO_SMALL */ #endif /* NANO_SMALL */
{ {