mirror of
https://github.com/jarun/nnn.git
synced 2024-12-01 02:49:44 +00:00
Fix #23
This commit is contained in:
parent
549fa4ba05
commit
cbbe03247e
4
nnn.c
4
nnn.c
|
@ -1592,13 +1592,13 @@ nochange:
|
||||||
|
|
||||||
/* If nlay doesn't handle it, open plain text
|
/* If nlay doesn't handle it, open plain text
|
||||||
files with vi, then try NNN_FALLBACK_OPENER */
|
files with vi, then try NNN_FALLBACK_OPENER */
|
||||||
strcpy(cmd, "file -b \"");
|
strcpy(cmd, "file -bi \"");
|
||||||
xstrlcpy(cmd + strlen(cmd), newpath, strlen(newpath) + 1);
|
xstrlcpy(cmd + strlen(cmd), newpath, strlen(newpath) + 1);
|
||||||
strcat(cmd, "\"");
|
strcat(cmd, "\"");
|
||||||
if (get_output(cmd, MAX_CMD_LEN) == NULL)
|
if (get_output(cmd, MAX_CMD_LEN) == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (strstr(cmd, "ASCII text") != NULL) {
|
if (strstr(cmd, "text/") == cmd) {
|
||||||
exitcurses();
|
exitcurses();
|
||||||
run = xgetenv("EDITOR", "vi");
|
run = xgetenv("EDITOR", "vi");
|
||||||
spawn(run, newpath, NULL, 0);
|
spawn(run, newpath, NULL, 0);
|
||||||
|
|
Loading…
Reference in a new issue