Make Fzlib_decompress_region always call the change hooks in a balanced way.
commit0aec5b8a5607505c1b492c10b67214f52f33972a
authorAlan Mackenzie <acm@muc.de>
Fri, 12 Jan 2018 16:31:35 +0000 (12 16:31 +0000)
committerAlan Mackenzie <acm@muc.de>
Fri, 12 Jan 2018 16:31:35 +0000 (12 16:31 +0000)
treec6b40d403503086612a7548c061a85754177b531
parent30e6e312d950400feac858e46f098f360a90d575
Make Fzlib_decompress_region always call the change hooks in a balanced way.

This means there will be exactly one call of each of before- and
after-change-functions, regardless of whether or not the decompression
succeeds, and these calls will refer to corresponding buffer regions.

src/decompress.c (struct decompress_unwind_data): add a new field, orig.
(unwind_decompress): Use del_range_2 and update_compositions in place of
del_range, to avoid unwanted change hook calls.  Call signal_after_change for
the failed case.
(Fzlib_decompress_region): Call modify_txt for a before-change-functions.  Set
the new field orig of unwind_data to the region's start.  Use del_range_2 and
update_compositions in place of del_range to avoid unwanted change hook
calls.  Call signal_after_change for the successful case.
src/decompress.c