aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-11-28 09:23:03 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-11-28 09:23:03 +0530
commit8aa72a40a3021508888441b60dd6f324eefe76ee (patch)
treec80c2e027df40169ff898469b656d035f9e36864
parent4b7833ed98a7eedc754b10c58428c4e94ab70a79 (diff)
downloadnnn-8aa72a40a3021508888441b60dd6f324eefe76ee.tar.gz
Use the -I option on OS X to identify file mime
-rw-r--r--src/nnn.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 1453d8c..aa6a6fe 100644
--- 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) {