* cmd.c (do_view_cmd): When asking confirmation, correctly

interpret closing the dialog by escape.
This commit is contained in:
Pavel Roskin 2002-10-21 05:43:09 +00:00
parent 31f1ddd081
commit a53c486e4f
2 changed files with 17 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2002-10-21 Pavel Roskin <proski@gnu.org>
* cmd.c (do_view_cmd): When asking confirmation, correctly
interpret closing the dialog by escape.
2002-10-20 Pavel Roskin <proski@gnu.org>
* utilunix.c (mc_tmpdir): Don't exit if the temporary directory

View File

@ -214,22 +214,24 @@ static int scan_for_file (WPanel *panel, int idx, int direction)
}
/* do_view: Invoked as the F3/F13 key. */
static void do_view_cmd (WPanel *panel, int normal)
static void
do_view_cmd (WPanel *panel, int normal)
{
int dir, file_idx;
panel = get_a_panel (panel);
/* Directories are viewed by changing to them */
if (S_ISDIR (selection (panel)->buf.st_mode) ||
link_isdir (selection (panel))) {
if (confirm_view_dir && (panel->marked || panel->dirs_marked)){
if (query_dialog (_(" CD "), _("Files tagged, want to cd?"),
0, 2, _("&Yes"), _("&No")) == 1){
if (S_ISDIR (selection (panel)->buf.st_mode)
|| link_isdir (selection (panel))) {
if (confirm_view_dir && (panel->marked || panel->dirs_marked)) {
if (query_dialog
(_(" Confirmation "), _("Files tagged, want to cd?"), 0, 2,
_("&Yes"), _("&No")) != 0) {
return;
}
}
if (!do_cd (selection (panel)->fname, cd_exact))
message (1, MSG_ERROR, _("Could not change directory") );
message (1, MSG_ERROR, _("Could not change directory"));
return;
@ -239,7 +241,7 @@ static void do_view_cmd (WPanel *panel, int normal)
while (1) {
char *filename;
filename = panel->dir.list [file_idx].fname;
filename = panel->dir.list[file_idx].fname;
dir = view_file (filename, normal, use_internal_view);
if (dir == 0)