mirror of
https://github.com/jarun/nnn.git
synced 2024-09-29 09:17:51 +00:00
Fix picker mode with file
This commit is contained in:
parent
cd4009dbf6
commit
c270b6002f
10
src/nnn.c
10
src/nnn.c
|
@ -4196,12 +4196,16 @@ int main(int argc, char *argv[])
|
||||||
if (optarg[0] == '-' && optarg[1] == '\0')
|
if (optarg[0] == '-' && optarg[1] == '\0')
|
||||||
cfg.pickraw = 1;
|
cfg.pickraw = 1;
|
||||||
else {
|
else {
|
||||||
/* copier used as tmp var */
|
int fd = open(optarg, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
|
||||||
copier = realpath(optarg, g_cppath);
|
|
||||||
if (!g_cppath) {
|
if (fd == -1) {
|
||||||
xerror();
|
xerror();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
close(fd);
|
||||||
|
g_cppath = realpath(optarg, NULL);
|
||||||
|
unlink(g_cppath);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
|
|
Loading…
Reference in a new issue