]> git.eshelyaron.com Git - emacs.git/commitdiff
Unconditionally prefer built-in decompression functions on Android
authorPo Lu <luangruo@yahoo.com>
Fri, 14 Jun 2024 07:11:04 +0000 (15:11 +0800)
committerEshel Yaron <me@eshelyaron.com>
Sat, 15 Jun 2024 17:21:13 +0000 (19:21 +0200)
* lisp/jka-compr.el (jka-compr-insert-file-contents): Prefer
built-in decompression functions (i.e., zlib) to external
agents.

(cherry picked from commit 9c9afd5235782bd987dea12ab89fd91e661ec89e)

lisp/jka-compr.el

index 8e6d14cc2900a211f6e776fd9e67beced499ef26..0a14f0ab2b77bf9c52790cd8761299c6f376e9e6 100644 (file)
@@ -402,15 +402,22 @@ There should be no more than seven characters after the final `/'."
          (setq buffer-file-name filename))
 
         (unwind-protect               ; to make sure local-copy gets deleted
-
             (progn
-
               (and
                uncompress-message
               jka-compr-verbose
                (message "%s %s..." uncompress-message base-name))
-
-              (if (and (not (executable-find uncompress-program))
+              (if (and (or (not (executable-find uncompress-program))
+                           ;; Android ships a bespoke version of gzip
+                           ;; that is absolutely useless for Emacs's
+                           ;; purposes, not supporting decompression or
+                           ;; reading input from elsewhere than stdin.
+                           ;;
+                           ;; This is only true of early releases of the
+                           ;; OS, but, since zlib is always available on
+                           ;; Android, simply unconditionally prefer the
+                           ;; built-in decompression function.
+                           (eq system-type 'android))
                        uncompress-function
                        (fboundp uncompress-function))
                   ;; If we don't have the uncompression program, then use the