mirror of
https://github.com/jarun/nnn.git
synced 2025-02-26 11:11:33 +00:00
Truncate output file before writing in picker mode
This commit is contained in:
parent
25fab4cb2e
commit
e2545f9596
1 changed files with 1 additions and 1 deletions
|
@ -8476,7 +8476,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
if (g_state.picker) {
|
if (g_state.picker) {
|
||||||
if (selbufpos) {
|
if (selbufpos) {
|
||||||
fd = selpath ? open(selpath, O_WRONLY | O_CREAT, 0600) : STDOUT_FILENO;
|
fd = selpath ? open(selpath, O_WRONLY | O_CREAT | O_TRUNC, 0600) : STDOUT_FILENO;
|
||||||
if ((fd == -1) || (seltofile(fd, NULL) != (size_t)(selbufpos)))
|
if ((fd == -1) || (seltofile(fd, NULL) != (size_t)(selbufpos)))
|
||||||
xerror();
|
xerror();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue