summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xranger/ext/rifle.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py
index 70215039..69a561a8 100755
--- a/ranger/ext/rifle.py
+++ b/ranger/ext/rifle.py
@@ -261,6 +261,11 @@ class Rifle(object):  # pylint: disable=too-many-instance-attributes
             process = Popen(["file", "--mime-type", "-Lb", fname], stdout=PIPE, stderr=PIPE)
             mimetype, _ = process.communicate()
             self._mimetype = mimetype.decode(ENCODING).strip()
+            if self._mimetype == 'application/octet-stream':
+                process = Popen(["mimetype", "--output-format", "%m", fname],
+                        stdout=PIPE, stderr=PIPE)
+                mimetype, _ = process.communicate()
+                self._mimetype = mimetype.decode(ENCODING).strip()
         return self._mimetype
 
     def _build_command(self, files, action, flags):