projects
/
nnn.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cd4009d
)
Fix picker mode with file
author
Arun Prakash Jana <engineerarun@gmail.com>
Mon, 22 Apr 2019 20:22:53 +0000 (
01:52
+0530)
committer
Arun Prakash Jana <engineerarun@gmail.com>
Mon, 22 Apr 2019 20:22:53 +0000 (
01:52
+0530)
src/nnn.c
patch
|
blob
|
history
diff --git
a/src/nnn.c
b/src/nnn.c
index 4208c1e52b036ea42a7ccafbcd5ecc6807eb6ac8..12fbfb3f25c8de78218e56c1da010e6646cf6334 100644
(file)
--- 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':