Skip to content

Commit 307f31b

Browse files
author
ripley
committed
zstd compression is in -19...19, not 9
git-svn-id: https://svn.r-project.org/R/trunk@87601 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent da26644 commit 307f31b

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/library/base/man/connections.Rd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ socketTimeout(socket, timeout = -1)
120120
requests. It is ignored for non-HTTP URLs. The \code{User-Agent}
121121
header, coming from the \code{HTTPUserAgent} option (see
122122
\code{\link{options}}) is used as the first header, automatically.}
123-
\item{compression}{integer in 0--9. The amount of compression to be
124-
applied when writing, from none to maximal available. For
125-
\code{xzfile} and \code{zstdfile} can also be negative: see the
126-
\sQuote{Compression} section.}
123+
\item{compression}{integer in 0--9 (1--19 for \code{zsdfile}). The
124+
amount of compression to be applied when writing, from minimal to
125+
maximal available. For \code{xzfile} and \code{zstdfile} can also
126+
be negative: see the \sQuote{Compression} section.}
127127
\item{timeout}{numeric: the timeout (in seconds) to be used for this
128128
connection. Beware that some OSes may treat very large values as
129129
zero: however the POSIX standard requires values up to 31 days to be

src/main/connections.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2754,11 +2754,16 @@ attribute_hidden SEXP do_gzfile(SEXP call, SEXP op, SEXP args, SEXP env)
27542754
if(compress == NA_LOGICAL || compress < 0 || compress > 9)
27552755
error(_("invalid '%s' argument"), "compress");
27562756
}
2757-
if(type == 2 || type == 3) {
2757+
if(type == 2) {
27582758
compress = asInteger(CADDDR(args));
27592759
if(compress == NA_LOGICAL || abs(compress) > 9)
27602760
error(_("invalid '%s' argument"), "compress");
27612761
}
2762+
if(type == 3) {
2763+
compress = asInteger(CADDDR(args));
2764+
if(compress == NA_LOGICAL || abs(compress) > 19)
2765+
error(_("invalid '%s' argument"), "compress");
2766+
}
27622767
open = CHAR(STRING_ELT(sopen, 0)); /* ASCII */
27632768
if (type == 0 && (!open[0] || open[0] == 'r')) {
27642769
/* check magic no */

0 commit comments

Comments
 (0)