Support file path quote on single copy

This commit is contained in:
Arun Prakash Jana 2018-01-28 12:04:56 +05:30
parent 6da9d5f499
commit d48e91f011
No known key found for this signature in database
GPG key ID: A75979F35C080412

15
nnn.c
View file

@ -2839,13 +2839,24 @@ nochange:
goto begin; goto begin;
case SEL_COPY: case SEL_COPY:
if (copier && ndents) { if (copier && ndents) {
r = mkpath(path, dents[cur].name, newpath, PATH_MAX);
if (cfg.copymode) { if (cfg.copymode) {
r = mkpath(path, dents[cur].name, newpath, PATH_MAX);
if (!appendfilepath(newpath, r)) if (!appendfilepath(newpath, r))
goto nochange; 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); spawn(copier, newpath, NULL, NULL, F_NONE);
printmsg(newpath); printmsg(newpath);
}
} else if (!copier) } else if (!copier)
printmsg(messages[STR_COPY_ID]); printmsg(messages[STR_COPY_ID]);
goto nochange; goto nochange;