unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Noam Postavsky <npostavs@gmail.com>
Cc: user42_kevin@yahoo.com.au, yamaoka@jpl.org, 33133@debbugs.gnu.org
Subject: bug#33133: 26.1.50; zlib-decompress-region too rigid
Date: Sun, 28 Oct 2018 17:41:17 +0200	[thread overview]
Message-ID: <837ei2m63m.fsf@gnu.org> (raw)
In-Reply-To: <87efcbjc2d.fsf@gmail.com> (message from Noam Postavsky on Sat, 27 Oct 2018 17:48:26 -0400)

> 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	other threads:[~2018-10-28 15:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23 23:07 bug#33133: 26.1.50; zlib-decompress-region too rigid Katsumi Yamaoka
2018-10-24  0:26 ` Noam Postavsky
2018-10-24  1:16   ` Katsumi Yamaoka
2018-10-27 21:48     ` Noam Postavsky
2018-10-28 15:41       ` Eli Zaretskii [this message]
2018-10-31  0:25         ` Noam Postavsky
2018-10-31 16:07           ` Eli Zaretskii
2019-04-03  2:09             ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837ei2m63m.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=33133@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    --cc=user42_kevin@yahoo.com.au \
    --cc=yamaoka@jpl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).