Commit f227436d authored by Dirk Eddelbuettel's avatar Dirk Eddelbuettel

Import Upstream version 3.2.4-revised

parent 5a9eeb64
Revision: 70301
Last Changed Date: 2016-03-10
Revision: 70336
Last Changed Date: 2016-03-16
3.2.4
3.2.4 Revised
This diff is collapsed.
......@@ -5,6 +5,16 @@
\title{R News}
\encoding{UTF-8}
\section{\Rlogo CHANGES IN R 3.2.4 patched}{
\subsection{BUG FIXES}{
\itemize{
\item \code{format.POSIXlt()} behaved wrongly, e.g.,
\code{format(as.POSIXlt(paste0(1940:2000,"-01-01"), tz="CET"),
usetz=TRUE)} ended in two \code{"CEST"} time formats.
}
}
}
\section{\Rlogo CHANGES IN R 3.2.4}{
\subsection{NEW FEATURES}{
\itemize{
......
No preview for this file type
......@@ -7,6 +7,23 @@
<h2>R News</h2>
<h3><img src="../help/figures/../../html/logo.jpg" alt="../../html/logo.jpg" /> CHANGES IN R 3.2.4 patched</h3>
<h4>BUG FIXES</h4>
<ul>
<li> <p><code>format.POSIXlt()</code> behaved wrongly, e.g.,
<code>format(as.POSIXlt(paste0(1940:2000,"-01-01"), tz="CET"),
usetz=TRUE)</code> ended in two <code>"CEST"</code> time formats.
</p>
</li></ul>
<h3><img src="../help/figures/../../html/logo.jpg" alt="../../html/logo.jpg" /> CHANGES IN R 3.2.4</h3>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This manual is for R, version 3.2.4 (2016-03-10).
<!-- This manual is for R, version 3.2.4 Revised (2016-03-16).
Copyright (C) 2001-2016 R Core Team
......@@ -333,7 +333,7 @@ p {
<p>This is a guide to installation and administration for R.
</p>
<p>This manual is for R, version 3.2.4 (2016-03-10).
<p>This manual is for R, version 3.2.4 Revised (2016-03-16).
</p>
<p>Copyright &copy; 2001&ndash;2016 R Core Team
</p>
......@@ -1323,7 +1323,7 @@ from <acronym>CRAN</acronym> to run on 32- or 64-bit Windows (XP or later) on
perhaps for some network-mounted systems).
</p>
<p>Installation is <em>via</em> the installer
<samp>R-3.2.4-win.exe</samp>. Just double-click on the icon and
<samp>R-3.2.4revised-win.exe</samp>. Just double-click on the icon and
follow the instructions. When installing on a 64-bit version of Windows
the options will include 32- or 64-bit versions of R (and the default is
to install both). You can uninstall R from the Control Panel.
......@@ -1721,7 +1721,7 @@ source tree) in <samp>src/gnuwin32/installer</samp> run
installation (in double quotes if it contains spaces or backslashes).
</p>
<p>Both methods create an executable with a standard name such as
<samp>R-3.2.4-win.exe</samp>, so please rename it to indicate that
<samp>R-3.2.4revised-win.exe</samp>, so please rename it to indicate that
it is customized. If you intend to <em>distribute</em> a customized
installer please do check that license requirements are met &ndash; note that
the installer will state that the contents are distributed under GPL
......@@ -1780,21 +1780,21 @@ make msi
</pre></div>
<p>which will result in a file with a name like
<samp>R-3.2.4-win32.msi</samp>. This can be double-clicked to be
<samp>R-3.2.4revised-win32.msi</samp>. This can be double-clicked to be
installed, but those who need it will know what to do with it (usually
by running <code>msiexec /i</code> with additional options). Properties
that users might want to set from the <code>msiexec</code> command line
include &lsquo;<samp>ALLUSERS</samp>&rsquo;, &lsquo;<samp>INSTALLDIR</samp>&rsquo; (something like
<samp>c:\Program Files\R\R-3.2.4</samp>) and &lsquo;<samp>RMENU</samp>&rsquo; (the path
<samp>c:\Program Files\R\R-3.2.4revised</samp>) and &lsquo;<samp>RMENU</samp>&rsquo; (the path
to the &lsquo;<samp>R</samp>&rsquo; folder on the start menu) and &lsquo;<samp>STARTDIR</samp>&rsquo; (the
starting directory for R shortcuts, defaulting to something like
<samp>c:\Users\name\Documents\R</samp>).
</p>
<p>The MSI installer can be built both from a 32-bit build of R
(<samp>R-3.2.4-win32.msi</samp>) and from a 64-bit build of R
(<samp>R-3.2.4-win64.msi</samp>, optionally including 32-bit files
(<samp>R-3.2.4revised-win32.msi</samp>) and from a 64-bit build of R
(<samp>R-3.2.4revised-win64.msi</samp>, optionally including 32-bit files
by setting the macro <code>HOME32</code>, when the name is
<samp>R-3.2.4-win.msi</samp>). Unlike the main installer, a 64-bit
<samp>R-3.2.4revised-win.msi</samp>). Unlike the main installer, a 64-bit
MSI installer can only be run on 64-bit Windows.
</p>
<p>Thanks to David del Campo (Dept of Statistics, University of Oxford)
......@@ -5795,7 +5795,7 @@ install LaTeX packages on first use.
<a name="The-Inno-Setup-installer-1"></a>
<h3 class="section">D.2 The Inno Setup installer</h3>
<p>To make the installer package (<samp>R-3.2.4-win.exe</samp>) we
<p>To make the installer package (<samp>R-3.2.4revised-win.exe</samp>) we
currently require the Unicode version of Inno Setup 5.3.7 or later from
<a href="http://jrsoftware.org/">http://jrsoftware.org/</a>. This is <em>not</em> included in
<samp>Rtools*.exe</samp>.
......
......@@ -58,7 +58,7 @@ stamp:
touch stamp
liblzma.a: $(liblzma_a_OBJECTS)
$rm -f $@
@rm -f $@
$(AR) -cr $@ $(liblzma_a_OBJECTS)
$(RANLIB) $@
......
/*
* R : A Computer Language for Statistical Data Analysis
* Copyright (C) 2000-2015 The R Core Team.
* Copyright (C) 2000-2016 The R Core Team.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -862,24 +862,23 @@ SEXP attribute_hidden do_asPOSIXct(SEXP call, SEXP op, SEXP args, SEXP env)
SEXP attribute_hidden do_formatPOSIXlt(SEXP call, SEXP op, SEXP args, SEXP env)
{
SEXP x, sformat, ans, tz;
R_xlen_t n = 0, m, N, nlen[9];
int UseTZ, settz = 0;
int settz = 0;
char buff[300];
char oldtz[1001] = "";
stm tm;
checkArity(op, args);
PROTECT(x = duplicate(CAR(args))); /* coerced below */
SEXP x = PROTECT(duplicate(CAR(args))); /* coerced below */
if(!isVectorList(x) || LENGTH(x) < 9)
error(_("invalid '%s' argument"), "x");
SEXP sformat;
if(!isString((sformat = CADR(args))) || XLENGTH(sformat) == 0)
error(_("invalid '%s' argument"), "format");
m = XLENGTH(sformat);
UseTZ = asLogical(CADDR(args));
R_xlen_t m = XLENGTH(sformat);
int UseTZ = asLogical(CADDR(args));
if(UseTZ == NA_LOGICAL)
error(_("invalid '%s' argument"), "usetz");
tz = getAttrib(x, install("tzone"));
SEXP tz = getAttrib(x, install("tzone"));
const char *tz1;
if (!isNull(tz) && strlen(tz1 = CHAR(STRING_ELT(tz, 0)))) {
......@@ -898,10 +897,12 @@ SEXP attribute_hidden do_formatPOSIXlt(SEXP call, SEXP op, SEXP args, SEXP env)
*/
memset(&tm, 0, sizeof(tm));
/* coerce fields to integer or real, find length of longest one */
/* coerce fields, find length of longest one */
R_xlen_t n = 0, nlen[9];
for(int i = 0; i < 9; i++) {
nlen[i] = XLENGTH(VECTOR_ELT(x, i));
if(nlen[i] > n) n = nlen[i];
// real for 'sec', the first; integer for the rest:
SET_VECTOR_ELT(x, i, coerceVector(VECTOR_ELT(x, i),
i > 0 ? INTSXP : REALSXP));
}
......@@ -910,8 +911,8 @@ SEXP attribute_hidden do_formatPOSIXlt(SEXP call, SEXP op, SEXP args, SEXP env)
if(nlen[i] == 0)
error(_("zero-length component in non-empty \"POSIXlt\" structure"));
}
if(n > 0) N = (m > n) ? m:n; else N = 0;
PROTECT(ans = allocVector(STRSXP, N));
R_xlen_t N = (n > 0) ? ((m > n) ? m : n) : 0;
SEXP ans = PROTECT(allocVector(STRSXP, N));
char tm_zone[20];
#ifdef HAVE_TM_GMTOFF
Rboolean have_zone = LENGTH(x) >= 11 && XLENGTH(VECTOR_ELT(x, 9)) == n &&
......@@ -951,79 +952,78 @@ SEXP attribute_hidden do_formatPOSIXlt(SEXP call, SEXP op, SEXP args, SEXP env)
tm.tm_hour == NA_INTEGER || tm.tm_mday == NA_INTEGER ||
tm.tm_mon == NA_INTEGER || tm.tm_year == NA_INTEGER) {
SET_STRING_ELT(ans, i, NA_STRING);
} else if(validate_tm(&tm) < 0) {
SET_STRING_ELT(ans, i, NA_STRING);
} else {
if(validate_tm(&tm) < 0) SET_STRING_ELT(ans, i, NA_STRING);
else {
const char *q = translateChar(STRING_ELT(sformat, i%m));
int n = (int) strlen(q) + 50;
char buf2[n];
const char *p;
const char *q = translateChar(STRING_ELT(sformat, i%m));
int nn = (int) strlen(q) + 50;
char buf2[nn];
const char *p;
#ifdef OLD_Win32
/* We want to override Windows' TZ names */
p = strstr(q, "%Z");
if (p) {
memset(buf2, 0, n);
strncpy(buf2, q, p - q);
if(have_zone)
strcat(buf2, tm_zone);
else
strcat(buf2, tm.tm_isdst > 0 ? R_tzname[1] : R_tzname[0]);
strcat(buf2, p+2);
} else
/* We want to override Windows' TZ names */
p = strstr(q, "%Z");
if (p) {
memset(buf2, 0, nn);
strncpy(buf2, q, p - q);
if(have_zone)
strcat(buf2, tm_zone);
else
strcat(buf2, tm.tm_isdst > 0 ? R_tzname[1] : R_tzname[0]);
strcat(buf2, p+2);
} else
#endif
strcpy(buf2, q);
p = strstr(q, "%OS");
if(p) {
/* FIXME some of this should be outside the loop */
int ns, nused = 4;
char *p2 = strstr(buf2, "%OS");
*p2 = '\0';
ns = *(p+3) - '0';
if(ns < 0 || ns > 9) { /* not a digit */
ns = asInteger(GetOption1(install("digits.secs")));
if(ns == NA_INTEGER) ns = 0;
nused = 3;
}
if(ns > 6) ns = 6;
if(ns > 0) {
/* truncate to avoid nuisances such as PR#14579 */
double s = secs, t = Rexp10((double) ns);
s = ((int) (s*t))/t;
sprintf(p2, "%0*.*f", ns+3, ns, s);
strcat(buf2, p+nused);
} else {
strcat(p2, "%S");
strcat(buf2, p+nused);
}
strcpy(buf2, q);
p = strstr(q, "%OS");
if(p) {
/* FIXME some of this should be outside the loop */
int ns, nused = 4;
char *p2 = strstr(buf2, "%OS");
*p2 = '\0';
ns = *(p+3) - '0';
if(ns < 0 || ns > 9) { /* not a digit */
ns = asInteger(GetOption1(install("digits.secs")));
if(ns == NA_INTEGER) ns = 0;
nused = 3;
}
// The overflow behaviour is not determined by C99.
// We assume truncation, and ensure termination.
if(ns > 6) ns = 6;
if(ns > 0) {
/* truncate to avoid nuisances such as PR#14579 */
double s = secs, t = Rexp10((double) ns);
s = ((int) (s*t))/t;
sprintf(p2, "%0*.*f", ns+3, ns, s);
strcat(buf2, p+nused);
} else {
strcat(p2, "%S");
strcat(buf2, p+nused);
}
}
// The overflow behaviour is not determined by C99.
// We assume truncation, and ensure termination.
#ifdef USE_INTERNAL_MKTIME
R_strftime(buff, 256, buf2, &tm);
R_strftime(buff, 256, buf2, &tm);
#else
strftime(buff, 256, buf2, &tm);
strftime(buff, 256, buf2, &tm);
#endif
buff[256] = '\0';
// Now assume tzone abbreviated name is < 40 bytes,
// but they are currently 3 or 4 bytes.
if(UseTZ) {
if(have_zone) {
const char *p = CHAR(STRING_ELT(VECTOR_ELT(x, 9), i%n));
if(strlen(p)) {strcat(buff, " "); strcat(buff, p);}
} else if(!isNull(tz)) {
int ii = 0;
if(LENGTH(tz) == 3) {
if(tm.tm_isdst > 0) ii = 2;
else if(tm.tm_isdst == 0) ii = 1;
else ii = 0; /* Use base timezone name */
}
const char *p = CHAR(STRING_ELT(tz, ii));
if(strlen(p)) {strcat(buff, " "); strcat(buff, p);}
buff[256] = '\0';
// Now assume tzone abbreviated name is < 40 bytes,
// but they are currently 3 or 4 bytes.
if(UseTZ) {
if(have_zone) {
const char *p = CHAR(STRING_ELT(VECTOR_ELT(x, 9), i%n));
if(strlen(p)) {strcat(buff, " "); strcat(buff, p);}
} else if(!isNull(tz)) {
int ii = 0;
if(LENGTH(tz) == 3) {
if(tm.tm_isdst > 0) ii = 2;
else if(tm.tm_isdst == 0) ii = 1;
else ii = 0; /* Use base timezone name */
}
const char *p = CHAR(STRING_ELT(tz, ii));
if(strlen(p)) {strcat(buff, " "); strcat(buff, p);}
}
SET_STRING_ELT(ans, i, mkChar(buff));
}
SET_STRING_ELT(ans, i, mkChar(buff));
}
}
if(settz) reset_tz(oldtz);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment