]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix #23
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 13 May 2017 04:57:49 +0000 (10:27 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 13 May 2017 04:57:49 +0000 (10:27 +0530)
nnn.c

diff --git a/nnn.c b/nnn.c
index 5bad5d9040caef7d5fb3a2cd1587d8b1972e0930..cedaff199a81b18eb562e34c53a6ccbf30b11040 100644 (file)
--- a/nnn.c
+++ b/nnn.c
@@ -1592,13 +1592,13 @@ nochange:
 
                                /* If nlay doesn't handle it, open plain text
                                   files with vi, then try NNN_FALLBACK_OPENER */
-                               strcpy(cmd, "file -b \"");
+                               strcpy(cmd, "file -bi \"");
                                xstrlcpy(cmd + strlen(cmd), newpath, strlen(newpath) + 1);
                                strcat(cmd, "\"");
                                if (get_output(cmd, MAX_CMD_LEN) == NULL)
                                        continue;
 
-                               if (strstr(cmd, "ASCII text") != NULL) {
+                               if (strstr(cmd, "text/") == cmd) {
                                        exitcurses();
                                        run = xgetenv("EDITOR", "vi");
                                        spawn(run, newpath, NULL, 0);