Merge branch '3150_achown_list_esc'

* 3150_achown_list_esc:
  Ticket #3150: achown: escape on user list should not accept value.
This commit is contained in:
Andrew Borodin 2014-02-07 09:23:04 +04:00
commit 38629e21de

View File

@ -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);
}