Skip to content
Browse files

branch update

git-svn-id: https://svn.r-project.org/R/trunk@29050 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
1 parent ac4a33d commit faf7cb1387014a024771f1ae03795eda420acb5d ripley committed
View
1 Makefile.in
@@ -35,6 +35,7 @@ ACLOCAL_DEPENDENCIES = \
acinclude.m4
ACINCLUDE_DEPENDENCIES = \
m4/R.m4 \
+ m4/codeset.m4 \
m4/gnome-gnorba-check.m4 \
m4/gnome-orbit-check.m4 \
m4/gnome.m4 \
View
4 NEWS
@@ -85,6 +85,10 @@ BUG FIXES
o as.data.frame.list() could fail on some unusual list names.
(PR#6782)
+ o type.convert() ignored na.strings when no conversion was done.
+ (PR#6781, not needed for its primary use in read.table.)
+
+
CHANGES IN R VERSION 1.9.0
View
23 acinclude.m4
@@ -2440,6 +2440,29 @@ use_recommended_packages=${r_cv_misc_recommended_packages}
### mode: outline-minor ***
### outline-regexp: "### [*]+" ***
### End: ***
+# codeset.m4 serial AM1 (gettext-0.10.40)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
+ [AC_TRY_LINK([#include <langinfo.h>],
+ [char* cs = nl_langinfo(CODESET);],
+ am_cv_langinfo_codeset=yes,
+ am_cv_langinfo_codeset=no)
+ ])
+ if test $am_cv_langinfo_codeset = yes; then
+ AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
+ [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
+ fi
+])
dnl
dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)
dnl
View
23 aclocal.m4
@@ -1949,6 +1949,29 @@ done])
use_recommended_packages=${r_cv_misc_recommended_packages}
])# R_RECOMMENDED_PACKAGES
+# codeset.m4 serial AM1 (gettext-0.10.40)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
+ [AC_TRY_LINK([#include <langinfo.h>],
+ [char* cs = nl_langinfo(CODESET);],
+ am_cv_langinfo_codeset=yes,
+ am_cv_langinfo_codeset=no)
+ ])
+ if test $am_cv_langinfo_codeset = yes; then
+ AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
+ [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
+ fi
+])
dnl
dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)
dnl
View
85 configure
@@ -22049,9 +22049,8 @@ fi
-
for ac_header in arpa/inet.h dl.h dlfcn.h elf.h fcntl.h floatingpoint.h \
- fpu_control.h grp.h ieee754.h ieeefp.h langinfo.h locale.h \
+ fpu_control.h grp.h ieee754.h ieeefp.h locale.h \
netdb.h netinet/in.h \
pwd.h readline/history.h readline/readline.h strings.h \
sys/param.h sys/select.h sys/socket.h sys/stat.h sys/time.h \
@@ -25000,7 +24999,7 @@ _ACEOF
# flags.
ac_save_FFLAGS=$FFLAGS
FFLAGS="$FFLAGS $ac_verb"
-(eval echo $as_me:25003: \"$ac_link\") >&5
+(eval echo $as_me:25002: \"$ac_link\") >&5
ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
echo "$ac_f77_v_output" >&5
FFLAGS=$ac_save_FFLAGS
@@ -25078,7 +25077,7 @@ _ACEOF
# flags.
ac_save_FFLAGS=$FFLAGS
FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
-(eval echo $as_me:25081: \"$ac_link\") >&5
+(eval echo $as_me:25080: \"$ac_link\") >&5
ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
echo "$ac_f77_v_output" >&5
FFLAGS=$ac_save_FFLAGS
@@ -28917,10 +28916,9 @@ fi
-
for ac_func in access chdir expm1 fcntl finite ftruncate getcwd \
getgrgid getpwuid getuid hypot isascii isnan log1p matherr mkfifo \
- nl_langinfo popen putenv rint setenv strcoll stat strptime symlink \
+ popen putenv rint setenv strcoll stat strptime symlink \
system times unsetenv
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -29035,6 +29033,81 @@ done
## might report corresponding HAVE_FOO conditionals.
## </NOTE>
+## check whether nl_langinfo(CODESET) is in langinfo.h
+## defines HAVE_LANGINFO_CODESET if it's there
+
+ echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5
+echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
+if test "${am_cv_langinfo_codeset+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <langinfo.h>
+#ifdef F77_DUMMY_MAIN
+
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+char* cs = nl_langinfo(CODESET);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_langinfo_codeset=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+am_cv_langinfo_codeset=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5
+echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
+ if test $am_cv_langinfo_codeset = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LANGINFO_CODESET 1
+_ACEOF
+
+ fi
+
+
## Used to build src/include/Rmath.h.
## <NOTE>
## we don't use AC_CONFIG_HEADERS on Rmath.h.in because
View
8 configure.ac
@@ -510,7 +510,7 @@ AC_HEADER_SYS_WAIT
## Some of these are also checked for when Autoconf computes the default
## includes.
AC_CHECK_HEADERS(arpa/inet.h dl.h dlfcn.h elf.h fcntl.h floatingpoint.h \
- fpu_control.h grp.h ieee754.h ieeefp.h langinfo.h locale.h \
+ fpu_control.h grp.h ieee754.h ieeefp.h locale.h \
netdb.h netinet/in.h \
pwd.h readline/history.h readline/readline.h strings.h \
sys/param.h sys/select.h sys/socket.h sys/stat.h sys/time.h \
@@ -1161,13 +1161,17 @@ AC_SUBST(LAPACK_LDFLAGS)
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(access chdir expm1 fcntl finite ftruncate getcwd \
getgrgid getpwuid getuid hypot isascii isnan log1p matherr mkfifo \
- nl_langinfo popen putenv rint setenv strcoll stat strptime symlink \
+ popen putenv rint setenv strcoll stat strptime symlink \
system times unsetenv)
## <NOTE>
## No need checking for bcopy bzero memcpy mempcpy even though ifnames
## might report corresponding HAVE_FOO conditionals.
## </NOTE>
+## check whether nl_langinfo(CODESET) is in langinfo.h
+## defines HAVE_LANGINFO_CODESET if it's there
+AM_LANGINFO_CODESET
+
## Used to build src/include/Rmath.h.
## <NOTE>
## we don't use AC_CONFIG_HEADERS on Rmath.h.in because
View
2 doc/html/R-admin.html
@@ -22,7 +22,7 @@ <h2 class="unnumbered">R Installation and Administration</h2>
<p>This is a guide to installation and administration for R.
- <p>The current version of this document is 2.0.0 (2004-04-17).
+ <p>The current version of this document is 2.0.0 (2004-04-18).
ISBN 3-900051-02-X
View
1 m4/Makefile.in
@@ -13,6 +13,7 @@ include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
DISTFILES = Makefile.in README \
R.m4 \
+ codeset.m4 \
gnome-gnorba-check.m4 \
gnome-orbit-check.m4 \
gnome.m4 \
View
4 m4/README
@@ -20,6 +20,10 @@ The files are as follows.
naming scheme. These test for `features' such as GNOME, zlib,
etc., are named R_$FEATURE, and typically define HAVE_$FEATURE.
+codeset.m4
+ is from GNU gettext and checks whether nl_langinfo(CODESET)
+ is available in langinfo.h.
+
gnome-gnorba-check.m4
gnome-orbit-check.m4
gnome.m4
View
23 m4/codeset.m4
@@ -0,0 +1,23 @@
+# codeset.m4 serial AM1 (gettext-0.10.40)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
+ [AC_TRY_LINK([#include <langinfo.h>],
+ [char* cs = nl_langinfo(CODESET);],
+ am_cv_langinfo_codeset=yes,
+ am_cv_langinfo_codeset=no)
+ ])
+ if test $am_cv_langinfo_codeset = yes; then
+ AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
+ [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
+ fi
+])
View
8 src/gnuwin32/fixed/h/config.h
@@ -179,9 +179,8 @@
/* Define if you have the JPEG headers and libraries. */
#define HAVE_JPEG 1
-
-/* Define to 1 if you have the <langinfo.h> header file. */
-/* #undef HAVE_LANGINFO_H */
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+/* #undef HAVE_LANGINFO_CODESET */
/* Define if external LAPACK is available. */
/* #undef HAVE_LAPACK */
@@ -234,9 +233,6 @@
/* Define to 1 if you have the <netinet/in.h> header file. */
/* #undef HAVE_NETINET_IN_H */
-/* Define to 1 if you have the `nl_langinfo' function. */
-/* #undef HAVE_NL_LANGINFO */
-
/* Define if module-loading does not need an underscore to be prepended to
external names. */
#define HAVE_NO_SYMBOL_UNDERSCORE 1
View
7 src/include/config.h.in
@@ -184,8 +184,8 @@
/* Define if you have the JPEG headers and libraries. */
#undef HAVE_JPEG
-/* Define to 1 if you have the <langinfo.h> header file. */
-#undef HAVE_LANGINFO_H
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
/* Define if external LAPACK is available. */
#undef HAVE_LAPACK
@@ -238,9 +238,6 @@
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
-/* Define to 1 if you have the `nl_langinfo' function. */
-#undef HAVE_NL_LANGINFO
-
/* Define if module-loading does not need an underscore to be prepended to
external names. */
#undef HAVE_NO_SYMBOL_UNDERSCORE
View
2 src/library/base/man/type.convert.Rd
@@ -13,7 +13,7 @@ type.convert(x, na.strings = "NA", as.is = FALSE, dec = ".")
\item{na.strings}{a vector of strings which are to be interpreted as
\code{\link{NA}} values. Blank fields are also considered to be
- missing values.}
+ missing values in logical, integer, numeric or complex vectors.}
\item{as.is}{logical. See Details.}
View
4 src/main/main.c
@@ -37,7 +37,7 @@
# include <locale.h>
#endif
-#ifdef HAVE_LANGINFO_H
+#ifdef HAVE_LANGINFO_CODESET
# include <langinfo.h>
#endif
@@ -459,7 +459,7 @@ void setup_Rmainloop(void)
RSetConsoleWidth();
}
#endif
-#ifdef HAVE_NL_LANGINFO
+#ifdef HAVE_LANGINFO_CODESET
utf8locale = strcmp(nl_langinfo(CODESET), "UTF-8") == 0;
#endif
/* gc_inhibit_torture = 0; */
View
4 src/main/platform.c
@@ -934,7 +934,7 @@ SEXP do_fileaccess(SEXP call, SEXP op, SEXP args, SEXP rho)
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
-#ifdef HAVE_LANGINFO_H
+#ifdef HAVE_LANGINFO_CODESET
# include <langinfo.h>
#endif
@@ -962,7 +962,7 @@ SEXP do_getlocale(SEXP call, SEXP op, SEXP args, SEXP rho)
if(p) SET_STRING_ELT(ans, 0, mkChar(p));
else SET_STRING_ELT(ans, 0, mkChar(""));
UNPROTECT(1);
-#ifdef HAVE_NL_LANGINFO
+#ifdef HAVE_LANGINFO_CODESET
utf8locale = strcmp(nl_langinfo(CODESET), "UTF-8") == 0;
#endif
return ans;
View
5 src/main/scan.c
@@ -1094,7 +1094,10 @@ SEXP do_typecvt(SEXP call, SEXP op, SEXP args, SEXP env)
if (!done) {
if (asIs) {
- PROTECT(rval = cvec); /* just to balance */
+ PROTECT(rval = duplicate(cvec));
+ for (i = 0; i < len; i++)
+ if(isNAstring(CHAR(STRING_ELT(rval, i)), 1, &data))
+ SET_STRING_ELT(rval, i, NA_STRING);
}
else {
PROTECT(rval = allocVector(INTSXP, len));
View
7 tests/reg-tests-1.R
@@ -3009,3 +3009,10 @@ xx <- list(row.names=1:2,foxglove=3:4,toadflax=5:6)
foo <- as.data.frame(xx)
stopifnot(identical(names(xx), names(foo)))
## 1.9.0 changed the last name to "x".
+
+
+## type.convert quirk (PR#6781)
+res1 <- type.convert( c("abc","-"), as.is=TRUE, na.strings="-" )
+stopifnot(identical(mode(res1), "character"), is.na(res1[2]))
+## res1[2] was "-" <= 1.9.0.
+

0 comments on commit faf7cb1

Please sign in to comment.
Something went wrong with that request. Please try again.