mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
(advanced_chown_cmd): use intermediate variables to make text more readable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
79c8a351ba
commit
a242e8b91f
@ -1050,32 +1050,33 @@ advanced_chown_cmd (WPanel * panel)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case B_ENTER:
|
case B_ENTER:
|
||||||
if (panel->marked <= 1)
|
|
||||||
{
|
{
|
||||||
/* single or last file */
|
uid_t uid = ch_flags[9] == '+' ? sf_stat.st_uid : (uid_t) (-1);
|
||||||
if (mc_chmod (vpath, get_mode ()) == -1)
|
gid_t gid = ch_flags[10] == '+' ? sf_stat.st_gid : (gid_t) (-1);
|
||||||
message (D_ERROR, MSG_ERROR, _("Cannot chmod \"%s\"\n%s"),
|
|
||||||
fname->str, unix_error_string (errno));
|
|
||||||
/* call mc_chown only, if mc_chmod didn't fail */
|
|
||||||
else if (mc_chown
|
|
||||||
(vpath, (ch_flags[9] == '+') ? sf_stat.st_uid : (uid_t) (-1),
|
|
||||||
(ch_flags[10] == '+') ? sf_stat.st_gid : (gid_t) (-1)) == -1)
|
|
||||||
message (D_ERROR, MSG_ERROR, _("Cannot chown \"%s\"\n%s"), fname->str,
|
|
||||||
unix_error_string (errno));
|
|
||||||
|
|
||||||
end_chown = TRUE;
|
if (panel->marked <= 1)
|
||||||
}
|
{
|
||||||
else if (!try_advanced_chown
|
/* single or last file */
|
||||||
(vpath, get_mode (), (ch_flags[9] == '+') ? sf_stat.st_uid : (uid_t) (-1),
|
if (mc_chmod (vpath, get_mode ()) == -1)
|
||||||
(ch_flags[10] == '+') ? sf_stat.st_gid : (gid_t) (-1)))
|
message (D_ERROR, MSG_ERROR, _("Cannot chmod \"%s\"\n%s"),
|
||||||
{
|
fname->str, unix_error_string (errno));
|
||||||
/* stop multiple files processing */
|
/* call mc_chown only, if mc_chmod didn't fail */
|
||||||
result = B_CANCEL;
|
else if (mc_chown (vpath, uid, gid) == -1)
|
||||||
end_chown = TRUE;
|
message (D_ERROR, MSG_ERROR, _("Cannot chown \"%s\"\n%s"), fname->str,
|
||||||
}
|
unix_error_string (errno));
|
||||||
|
|
||||||
need_update = TRUE;
|
end_chown = TRUE;
|
||||||
break;
|
}
|
||||||
|
else if (!try_advanced_chown (vpath, get_mode (), uid, gid))
|
||||||
|
{
|
||||||
|
/* stop multiple files processing */
|
||||||
|
result = B_CANCEL;
|
||||||
|
end_chown = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
need_update = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case B_SETALL:
|
case B_SETALL:
|
||||||
apply_advanced_chowns (panel, vpath, &sf_stat);
|
apply_advanced_chowns (panel, vpath, &sf_stat);
|
||||||
|
Loading…
Reference in New Issue
Block a user