File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed
Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 1+ 2017-02-14 Iñaki Ucar <
[email protected] >
2+
3+ * inst/include/Rcpp/iostream/Rstreambuf.h: Fixed single-character handling
4+ (pull request #649, fixes issue #647)
5+
162017-02-13 Dirk Eddelbuettel <
[email protected] >
27
38 * R/Attributes.R (.plugins[["cpp17"]]): New plugin
Original file line number Diff line number Diff line change 99 \itemize {
1010 \item Added new size attribute aliases for number of rows and columns in
1111 DataFrame (James Balamuta in \ghpr {638 } addressing \ghit {630 }).
12+ \item Fixed single - character handling in \code {Rstreambuf } (I ñaki Ucar in
13+ \ghpr {649 } addressing \ghit {647 }).
1214 }
1315 \item Changes in Rcpp Sugar :
1416 \itemize {
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ namespace Rcpp {
3535 protected:
3636 virtual std::streamsize xsputn (const char *s, std::streamsize n );
3737
38- virtual int overflow (int c = EOF );
38+ virtual int overflow (int c = traits_type::eof() );
3939
4040 virtual int sync () ;
4141 };
@@ -67,12 +67,18 @@ namespace Rcpp {
6767 }
6868
6969 template <> inline int Rstreambuf<true >::overflow(int c ) {
70- if (c != EOF) Rprintf ( " %.1s" , &c ) ;
71- return c ;
70+ if (c != traits_type::eof ()) {
71+ char_type ch = traits_type::to_char_type (c);
72+ return xsputn (&ch, 1 ) == 1 ? c : traits_type::eof ();
73+ }
74+ return c;
7275 }
7376 template <> inline int Rstreambuf<false >::overflow(int c ) {
74- if (c != EOF) REprintf ( " %.1s" , &c ) ;
75- return c ;
77+ if (c != traits_type::eof ()) {
78+ char_type ch = traits_type::to_char_type (c);
79+ return xsputn (&ch, 1 ) == 1 ? c : traits_type::eof ();
80+ }
81+ return c;
7682 }
7783
7884 template <> inline int Rstreambuf<true >::sync(){
You can’t perform that action at this time.
0 commit comments