diff --git a/ChangeLog b/ChangeLog index bce56a36b66f947025a6e7afc46b26ecbf7b6512..021d7fac4a79aa7dea3d91c4d1fa31c69c787564 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ CVS code - - Stat full_path, not path (Steven Kneizys). open_pipe() - I18nize the pipe error (DLR). + do_insertfile() + - Handle cancel from ExtCmd properly (David Benbennick). read_file() - 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 diff --git a/files.c b/files.c index b94838da90a29fa935f6d48f336ef87c8b52723a..0df7b24db261e23baac9d9c6b0b5b07934b92c76 100644 --- a/files.c +++ b/files.c @@ -472,6 +472,19 @@ int do_insertfile(int loading_file) } #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 if (loading_file) { @@ -485,16 +498,7 @@ int do_insertfile(int loading_file) #ifndef NANO_SMALL 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 #endif /* NANO_SMALL */