]> git.eshelyaron.com Git - emacs.git/commitdiff
* decompress.c (unwind_decompress): Always restore point.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 14 Aug 2013 12:47:05 +0000 (14:47 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 14 Aug 2013 12:47:05 +0000 (14:47 +0200)
src/ChangeLog
src/decompress.c

index c8a1de49d6816c007c8547df719062627c820ede..eeae85a888cf17fabb4ab640d823d0c89ceaf007 100644 (file)
@@ -1,3 +1,7 @@
+2013-08-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * decompress.c (unwind_decompress): Always restore point.
+
 2013-08-14  Paul Eggert  <eggert@cs.ucla.edu>
 
        * xdisp.c (cursor_type_changed): Now static.
index c54a34e050e17ee986cf114b2c4d6f364ab63328..b4e122c3ba88f4dc1a6cf12da930b0622fd2ca42 100644 (file)
@@ -95,12 +95,14 @@ unwind_decompress (void *ddata)
   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,