diff --git a/src/filemanager/achown.c b/src/filemanager/achown.c index 2a1072d25..c9d6ebe50 100644 --- a/src/filemanager/achown.c +++ b/src/filemanager/achown.c @@ -369,53 +369,57 @@ do_enter_key (WDialog * h, int f_pos) result = dlg_run (chl_dlg); - if (b_pos != chl_list->pos) + if (result != B_CANCEL) { - gboolean ok = FALSE; - char *text; + if (b_pos != chl_list->pos) + { + gboolean ok = FALSE; + char *text; - listbox_get_current (chl_list, &text, NULL); - if (is_owner) - { - chl_pass = getpwnam (text); - if (chl_pass != NULL) + listbox_get_current (chl_list, &text, NULL); + if (is_owner) { - ok = TRUE; - sf_stat->st_uid = chl_pass->pw_uid; + chl_pass = getpwnam (text); + if (chl_pass != NULL) + { + ok = TRUE; + sf_stat->st_uid = chl_pass->pw_uid; + } } - } - else - { - chl_grp = getgrnam (text); - if (chl_grp != NULL) + else { - sf_stat->st_gid = chl_grp->gr_gid; - ok = TRUE; + chl_grp = getgrnam (text); + if (chl_grp != NULL) + { + sf_stat->st_gid = chl_grp->gr_gid; + ok = TRUE; + } } + if (ok) + { + ch_flags[f_pos + 6] = '+'; + update_ownership (); + } + dlg_focus (h); + if (ok) + print_flags (); } - if (ok) + if (result == KEY_LEFT) { - ch_flags[f_pos + 6] = '+'; - update_ownership (); + if (!is_owner) + chl_end = TRUE; + dlg_one_up (ch_dlg); + f_pos--; + } + else if (result == KEY_RIGHT) + { + if (is_owner) + chl_end = TRUE; + dlg_one_down (ch_dlg); + f_pos++; } - dlg_focus (h); - if (ok) - print_flags (); - } - if (result == KEY_LEFT) - { - if (!is_owner) - chl_end = TRUE; - dlg_one_up (ch_dlg); - f_pos--; - } - else if (result == KEY_RIGHT) - { - if (is_owner) - chl_end = TRUE; - dlg_one_down (ch_dlg); - f_pos++; } + /* Here we used to redraw the window */ dlg_destroy (chl_dlg); }