diff options
| author | 2018-11-20 19:58:07 +0530 | |
|---|---|---|
| committer | 2018-11-20 19:58:07 +0530 | |
| commit | 57613de18b728fd4163964d9d8340402b70ddcab (patch) | |
| tree | 17d090117dbf2a45c365e6dd6842147a3ab77341 /src | |
| parent | 362fd8ce78abe0115788b327eb16f4f9751506e7 (diff) | |
| download | nnn-57613de18b728fd4163964d9d8340402b70ddcab.tar.gz | |
Show warnings for copy, move, multiple remove
Diffstat (limited to 'src')
| -rw-r--r-- | src/nnn.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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) |