aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-01-28 12:04:56 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-01-28 12:04:56 +0530
commitd48e91f01186b5b540c83968422ba94e0dff1148 (patch)
tree0e4c46faa04f662e6361d1ca825178e36a7359eb
parent6da9d5f499e133ef693ab743d65e2fc79cc08d24 (diff)
downloadnnn-d48e91f01186b5b540c83968422ba94e0dff1148.tar.gz
Support file path quote on single copy
-rw-r--r--nnn.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/nnn.c b/nnn.c
index d69ab3b..d9fa5c1 100644
--- a/nnn.c
+++ b/nnn.c
@@ -2839,13 +2839,24 @@ nochange:
goto begin;
case SEL_COPY:
if (copier && ndents) {
- r = mkpath(path, dents[cur].name, newpath, PATH_MAX);
if (cfg.copymode) {
+ r = mkpath(path, dents[cur].name, newpath, PATH_MAX);
if (!appendfilepath(newpath, r))
goto nochange;
- } else
+ printmsg(newpath);
+ } else if (cfg.quote) {
+ g_buf[0] = '\'';
+ r = mkpath(path, dents[cur].name, g_buf + 1, PATH_MAX);
+ g_buf[r] = '\'';
+ g_buf[r + 1] = '\0';
+
+ spawn(copier, g_buf, NULL, NULL, F_NONE);
+ printmsg(g_buf);
+ } else {
+ mkpath(path, dents[cur].name, newpath, PATH_MAX);
spawn(copier, newpath, NULL, NULL, F_NONE);
- printmsg(newpath);
+ printmsg(newpath);
+ }
} else if (!copier)
printmsg(messages[STR_COPY_ID]);
goto nochange;