trash dir is ~/.local/trash

This commit is contained in:
Arun Prakash Jana 2019-03-02 18:45:15 +05:30
parent 62d1ff278f
commit ff2bfff386
No known key found for this signature in database
GPG key ID: A75979F35C080412
3 changed files with 3 additions and 9 deletions

View file

@ -393,7 +393,7 @@ The following indicators are used in the detail view:
| `NNN_NO_AUTOSELECT=1` | do not auto-select matching dir in _nav-as-you-type` mode | | `NNN_NO_AUTOSELECT=1` | do not auto-select matching dir in _nav-as-you-type` mode |
| `NNN_RESTRICT_NAV_OPEN=1` | open files on <kbd></kbd>, not <kbd></kbd> or <kbd>l</kbd> | | `NNN_RESTRICT_NAV_OPEN=1` | open files on <kbd></kbd>, not <kbd></kbd> or <kbd>l</kbd> |
| `NNN_RESTRICT_0B=1` | do not open 0-byte files | | `NNN_RESTRICT_0B=1` | do not open 0-byte files |
| `NNN_TRASH=1` | move files to `~/.local/share/nnn/trash` on delete | | `NNN_TRASH=1` | move files to `~/.local/trash` on delete |
| `NNN_CP_MV_PROG=1` | show copy, move progress on Linux | | `NNN_CP_MV_PROG=1` | show copy, move progress on Linux |
#### Help #### Help

2
nnn.1
View file

@ -348,7 +348,7 @@ files.
export NNN_RESTRICT_0B=1 export NNN_RESTRICT_0B=1
.Ed .Ed
.Pp .Pp
\fBNNN_TRASH:\fR move files to \fB~/.local/share/nnn/trash\fR on delete. \fBNNN_TRASH:\fR move files to \fB~/.local/trash\fR on delete.
.Bd -literal .Bd -literal
export NNN_TRASH=1 export NNN_TRASH=1
.Ed .Ed

View file

@ -4125,13 +4125,7 @@ int main(int argc, char *argv[])
/* Create trash dir if missing */ /* Create trash dir if missing */
g_tmpfplen = xstrlcpy(g_trash, home, PATH_MAX); g_tmpfplen = xstrlcpy(g_trash, home, PATH_MAX);
g_tmpfplen += xstrlcpy(g_trash + g_tmpfplen - 1, xstrlcpy(g_trash + g_tmpfplen - 1, "/.local/trash", PATH_MAX - g_tmpfplen);
"/.local/share/nnn", PATH_MAX - g_tmpfplen);
DPRINTF_S(g_trash);
if (!createdir(g_trash, 0777))
return 1;
xstrlcpy(g_trash + g_tmpfplen - 2, "/trash", PATH_MAX - g_tmpfplen);
DPRINTF_S(g_trash); DPRINTF_S(g_trash);
if (!createdir(g_trash, 0777)) if (!createdir(g_trash, 0777))
return 1; return 1;