changeset 10969:da355a1a6d44

fix scanf char class conversion bug
author John W. Eaton <jwe@octave.org>
date Tue, 14 Sep 2010 01:58:11 -0400
parents f5c863803e29
children 795400289d1c
files src/ChangeLog src/oct-stream.cc
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2010-09-14  John W. Eaton  <jwe@octave.org>
+
+	* oct-stream.cc (BEGIN_CHAR_CLASS_CONVERSION):
+	If we hit EOF but have found a match, clear the stream state.
+
 2010-09-13  Jaroslav Hajek  <highegg@gmail.com>
 
 	* DLD-FUNCTIONS/cellfun.cc (Fcellfun): Remove subsref optimization.
--- a/src/oct-stream.cc
+++ b/src/oct-stream.cc
@@ -1657,6 +1657,9 @@
  \
       if (tmp.empty ()) \
         is.setstate (std::ios::failbit); \
+      else if (c == EOF) \
+        is.clear (); \
+ \
     } \
   while (0)