bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#33133: 26.1.50; zlib-decompress-region too rigid


From: Eli Zaretskii
Subject: bug#33133: 26.1.50; zlib-decompress-region too rigid
Date: Sun, 28 Oct 2018 17:41:17 +0200

> From: Noam Postavsky <npostavs@gmail.com>
> Date: Sat, 27 Oct 2018 17:48:26 -0400
> Cc: Kevin Ryde <user42_kevin@yahoo.com.au>, 33133@debbugs.gnu.org
> 
> Here's a proper patch.

Thanks.  I have a few comments:

> +data.  If @var{allow-partial} is @code{nil}, on failure, the function

We usually say "nil or omitted" for optional arguments.  Also, I'd say
"then on failure, ...", otherwise this could be misinterpreted as if
"on failure" qualifies the "is nil" part.

Same comment regarding the doc string of the function.

> +leaves the region unchanged and returns @code{nil}.  Otherwise, it
> +returns the number of bytes that were not decompressed and replaces
> +the region text by whatever data was successfully decompressed.  This
> +function can be called only in unibyte buffers.

Maybe it would make sense here to say that this emulates what 'gzip'
does?

> +  Lisp_Object ret = Qt;
>    if (inflate_status != Z_STREAM_END)
> -    return unbind_to (count, Qnil);
> +    {
> +      if (!NILP (allow_partial))
> +        ret = make_int (iend - pos_byte);
> +      else
> +        return unbind_to (count, Qnil);
> +    }

Hmm... should we display a warning message, like gzip does?





reply via email to

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