aboutsummaryrefslogtreecommitdiff
path: root/nov.el
diff options
context:
space:
mode:
Diffstat (limited to 'nov.el')
-rw-r--r--nov.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/nov.el b/nov.el
index 0e403c1..6f325be 100644
--- a/nov.el
+++ b/nov.el
@@ -146,6 +146,10 @@ Unnecessary nesting is removed with `nov-unnest-directory'."
(defun nov-slurp (filename)
"Return the contents of FILENAME."
+ ;; HACK: unzip preserves file permissions, no matter how silly they
+ ;; are, so ensure files are readable
+ (when (not (file-readable-p filename))
+ (set-file-modes filename #o444))
(with-temp-buffer
(insert-file-contents filename)
(buffer-string)))