nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit c270b6002f1b7a32ff1ec6ce094b101ca9d396d5
parent cd4009dbf6ed9c3ff22cf84e2818d6c938692cee
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date:   Tue, 23 Apr 2019 01:52:53 +0530

Fix picker mode with file

Diffstat:
Msrc/nnn.c | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/nnn.c b/src/nnn.c @@ -4196,12 +4196,16 @@ int main(int argc, char *argv[]) if (optarg[0] == '-' && optarg[1] == '\0') cfg.pickraw = 1; else { - /* copier used as tmp var */ - copier = realpath(optarg, g_cppath); - if (!g_cppath) { + int fd = open(optarg, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); + + if (fd == -1) { xerror(); return 1; } + + close(fd); + g_cppath = realpath(optarg, NULL); + unlink(g_cppath); } break; case 's':