[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mysterious gzipped images

From: Lars Magne Ingebrigtsen
Subject: Re: Mysterious gzipped images
Date: Wed, 14 Aug 2013 01:40:00 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

I was tracking down a parsing problem, and the cause was that
zlib-decompress-region moves point around.  If it left point "where it
was" (for some value of), then things would be OK.  And that seems like
a nicer behaviour, anyway.

So I tried the following, but it doesn't help.  Point is stubbornly at
the end of the buffer here:

 (url-retrieve "https://icons.duckduckgo.com/i/a-z-animals.com.ico"; (lambda 
(&rest ignore) (pop-to-buffer (current-buffer))))

I'm probably doing something stupid, and I'm too tired to see what it
is.  gdb claims that old_point is what is should be -- the start of the
=== modified file 'src/decompress.c'
--- src/decompress.c    2013-08-13 21:17:09 +0000
+++ src/decompress.c    2013-08-13 23:28:30 +0000
@@ -95,12 +95,14 @@
   struct decompress_unwind_data *data = ddata;
   fn_inflateEnd (data->stream);
-  /* Delete any uncompressed data already inserted and restore point.  */
+  /* Delete any uncompressed data already inserted on error.  */
   if (data->start)
-    {
-      del_range (data->start, PT);
-      SET_PT (data->old_point);
-    }
+    del_range (data->start, PT);
+  /* Put point where it was, or if the buffer has shrunk because the
+     compressed data is bigger than the uncompressed, at
+     point-max.  */
+  SET_PT (min (data->old_point, ZV));
 DEFUN ("zlib-available-p", Fzlib_available_p, Szlib_available_p, 0, 0, 0,

(domestic pets only, the antidote for overdose, milk.)
  No Gnus T-Shirt for sale: http://ingebrigtsen.no/no.php
  and http://lars.ingebrigtsen.no/2013/08/twenty-years-of-september.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]