]> Sergey Matveev's repositories - nnn.git/commitdiff
Use the -I option on OS X to identify file mime
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 28 Nov 2018 03:53:03 +0000 (09:23 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 28 Nov 2018 03:53:03 +0000 (09:23 +0530)
src/nnn.c

index 1453d8ca888c66ea989734c925dc94099e6d8cea..aa6a6fe8eeebf5bd26a964e6874e0d77285a6efb 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -331,6 +331,13 @@ static struct timespec gtimeout;
 #define REPLACE_STR 'I'
 #endif
 
+/* Options to identify file mime */
+#ifdef __APPLE__
+#define FILE_OPTS "-bI"
+#else
+#define FILE_OPTS "-bi"
+#endif
+
 /* Macros for utilities */
 #define MEDIAINFO 0
 #define EXIFTOOL 1
@@ -2657,7 +2664,7 @@ nochange:
                                        /* Recognize and open plain
                                         * text files with vi
                                         */
-                                       if (get_output(g_buf, MAX_CMD_LEN, "file", "-bi", newpath, 0) == NULL)
+                                       if (get_output(g_buf, MAX_CMD_LEN, "file", FILE_OPTS, newpath, 0) == NULL)
                                                continue;
 
                                        if (strstr(g_buf, "text/") == g_buf) {