* 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> 2002-10-20 Pavel Roskin <proski@gnu.org>
* utilunix.c (mc_tmpdir): Don't exit if the temporary directory * utilunix.c (mc_tmpdir): Don't exit if the temporary directory

View File

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