From: Lars Magne Ingebrigtsen Date: Wed, 14 Aug 2013 12:47:05 +0000 (+0200) Subject: * decompress.c (unwind_decompress): Always restore point. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1686^2~251 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=71530c97bfa0a2527f6b99ab2bc00865bc8699f2;p=emacs.git * decompress.c (unwind_decompress): Always restore point. --- diff --git a/src/ChangeLog b/src/ChangeLog index c8a1de49d68..eeae85a888c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2013-08-14 Lars Magne Ingebrigtsen + + * decompress.c (unwind_decompress): Always restore point. + 2013-08-14 Paul Eggert * xdisp.c (cursor_type_changed): Now static. diff --git a/src/decompress.c b/src/decompress.c index c54a34e050e..b4e122c3ba8 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -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,