Show warnings for copy, move, multiple remove

This commit is contained in:
Arun Prakash Jana 2018-11-20 19:58:07 +05:30
parent 362fd8ce78
commit 57613de18b
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 13 additions and 0 deletions

View File

@ -3046,11 +3046,24 @@ nochange:
case SEL_MV:
case SEL_RMMUL:
{
/* Fail if copy file path not generated */
if (!g_cppath[0]) {
printmsg("copy file not found");
goto nochange;
}
/* Warn if selection not completed */
if (cfg.copymode) {
printmsg("finish selection first");
goto nochange;
}
/* Fail if copy file path isn't created */
if (access(g_cppath, R_OK) == -1) {
printmsg("empty selection list");
goto nochange;
}
if (sel == SEL_CP)
snprintf(g_buf, MAX_CMD_LEN, "xargs -0 -d \'\n\' -a %s cp -ir --preserve=all -t .", g_cppath);
else if (sel == SEL_MV)