]> code.delx.au - gnu-emacs/commitdiff
Fix bug #18650 with warning about zlib when loading url-vars.el.
authorEli Zaretskii <eliz@gnu.org>
Tue, 7 Oct 2014 17:18:07 +0000 (20:18 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 7 Oct 2014 17:18:07 +0000 (20:18 +0300)
 src/decompress.c (init_zlib_functions): Move the message about zlib
 being unavailable from here...
 (Fzlib_decompress_region): ...to here.

 lisp/url/url-http.el (url-http-create-request): Recheck zlib availability
 on windows-nt each time it might be required.

lisp/url/ChangeLog
lisp/url/url-http.el
src/ChangeLog
src/decompress.c

index 81096cfb8007d027c8bbafe21669f0dd18415a48..21a779f85b38db932f54934ad145673074aae4a9 100644 (file)
@@ -1,3 +1,8 @@
+2014-10-07  Eli Zaretskii  <eliz@gnu.org>
+
+       * url-http.el (url-http-create-request): Recheck zlib availability
+       on windows-nt each time it might be required.  (Bug#18650)
+
 2014-09-28  Ulf Jasper  <ulf.jasper@web.de>
 
        * url-gw.el (url-open-stream): New optional parameter
index 9a874c25ce0b2fee632c61d3cd31c644678c9f61..f9fbea1ba743e2884f6f3de011d47336021d76e2 100644 (file)
@@ -313,7 +313,14 @@ request.")
                  (concat
                   "From: " url-personal-mail-address "\r\n"))
              ;; Encodings we understand
-             (if url-mime-encoding-string
+             (if (or url-mime-encoding-string
+                    ;; MS-Windows loads zlib dynamically, so recheck
+                    ;; in case they made it available since
+                    ;; initialization in url-vars.el.
+                    (and (eq 'system-type 'windows-nt)
+                         (fboundp 'zlib-available-p)
+                         (zlib-available-p)
+                         (setq url-mime-encoding-string "gzip")))
                  (concat
                   "Accept-encoding: " url-mime-encoding-string "\r\n"))
              (if url-mime-charset-string
index b57c76d5e3fb8d1bd13971f55a0c39517a4d257b..7a6b38f3b90d5c26d8d15aa6d1f62a5eda4545cf 100644 (file)
@@ -1,3 +1,9 @@
+2014-10-07  Eli Zaretskii  <eliz@gnu.org>
+
+       * decompress.c (init_zlib_functions): Move the message about zlib
+       being unavailable from here...
+       (Fzlib_decompress_region): ...to here.  (Bug#18650)
+
 2014-10-07  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * font.c (Ffont_get_glyphs): Use validate_subarray and fix
index cd8a3d1e9626264e85a38f2456b85a67119b1e4f..24ce852245c99de12c087d7461a39f5664da868e 100644 (file)
@@ -60,10 +60,7 @@ init_zlib_functions (void)
   HMODULE library = w32_delayed_load (Qzlib_dll);
 
   if (!library)
-    {
-      message1 ("zlib library not found");
-      return false;
-    }
+    return false;
 
   LOAD_ZLIB_FN (library, inflateInit2_);
   LOAD_ZLIB_FN (library, inflate);
@@ -150,7 +147,10 @@ This function can be called only in unibyte buffers.  */)
   if (!zlib_initialized)
     zlib_initialized = init_zlib_functions ();
   if (!zlib_initialized)
-    return Qnil;
+    {
+      message1 ("zlib library not found");
+      return Qnil;
+    }
 #endif
 
   /* This is a unibyte buffer, so character positions and bytes are