mirror of
https://github.com/jarun/nnn.git
synced 2025-02-26 03:01:32 +00:00
X11 file paths copy is ad-hoc
This commit is contained in:
parent
dd1eb788d5
commit
2f2f895bcb
1 changed files with 7 additions and 11 deletions
18
src/nnn.c
18
src/nnn.c
|
@ -3002,9 +3002,8 @@ nochange:
|
||||||
g_buf[r] = '\'';
|
g_buf[r] = '\'';
|
||||||
g_buf[r + 1] = '\0';
|
g_buf[r + 1] = '\0';
|
||||||
|
|
||||||
if (!copier)
|
writecp(g_buf, r + 1); /* Truncate NULL from end */
|
||||||
writecp(g_buf, r + 1); /* Truncate NULL from end */
|
if (copier)
|
||||||
else
|
|
||||||
spawn(copier, g_buf, NULL, NULL, F_NOTRACE);
|
spawn(copier, g_buf, NULL, NULL, F_NOTRACE);
|
||||||
|
|
||||||
g_buf[r] = '\0';
|
g_buf[r] = '\0';
|
||||||
|
@ -3015,9 +3014,8 @@ nochange:
|
||||||
copybufpos = 0;
|
copybufpos = 0;
|
||||||
appendfpath(newpath, r);
|
appendfpath(newpath, r);
|
||||||
|
|
||||||
if (!copier)
|
writecp(newpath, r - 1); /* Truncate NULL from end */
|
||||||
writecp(newpath, r - 1); /* Truncate NULL from end */
|
if (copier)
|
||||||
else
|
|
||||||
spawn(copier, newpath, NULL, NULL, F_NOTRACE);
|
spawn(copier, newpath, NULL, NULL, F_NOTRACE);
|
||||||
|
|
||||||
printmsg(newpath);
|
printmsg(newpath);
|
||||||
|
@ -3056,9 +3054,8 @@ nochange:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copybufpos) { /* File path(s) written to the buffer */
|
if (copybufpos) { /* File path(s) written to the buffer */
|
||||||
if (!copier)
|
writecp(pcopybuf, copybufpos - 1); /* Truncate NULL from end */
|
||||||
writecp(pcopybuf, copybufpos - 1); /* Truncate NULL from end */
|
if (copier)
|
||||||
else
|
|
||||||
spawn(copier, pcopybuf, NULL, NULL, F_NOTRACE);
|
spawn(copier, pcopybuf, NULL, NULL, F_NOTRACE);
|
||||||
|
|
||||||
if (ncp) { /* Some files cherry picked */
|
if (ncp) { /* Some files cherry picked */
|
||||||
|
@ -3549,8 +3546,7 @@ int main(int argc, char *argv[])
|
||||||
else if (xdiraccess("/tmp"))
|
else if (xdiraccess("/tmp"))
|
||||||
g_tmpfplen = xstrlcpy(g_tmpfpath, "/tmp", MAX_HOME_LEN);
|
g_tmpfplen = xstrlcpy(g_tmpfpath, "/tmp", MAX_HOME_LEN);
|
||||||
|
|
||||||
/* Check if X11 is available */
|
if (g_tmpfplen) {
|
||||||
if (!copier && g_tmpfplen) {
|
|
||||||
xstrlcpy(g_cppath, g_tmpfpath, MAX_HOME_LEN);
|
xstrlcpy(g_cppath, g_tmpfpath, MAX_HOME_LEN);
|
||||||
xstrlcpy(g_cppath + g_tmpfplen - 1, "/.nnncp", MAX_HOME_LEN - g_tmpfplen);
|
xstrlcpy(g_cppath + g_tmpfplen - 1, "/.nnncp", MAX_HOME_LEN - g_tmpfplen);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue