diff src/oct-stream.cc @ 3337:9c782a34b545

[project @ 1999-11-04 01:51:34 by jwe]
author jwe
date Thu, 04 Nov 1999 01:51:34 +0000
parents fdc7dd08cd85
children 585a8809fd9b
line wrap: on
line diff
--- a/src/oct-stream.cc
+++ b/src/oct-stream.cc
@@ -1264,6 +1264,12 @@
 		      final_nc = 1;
 		    }
 
+		  // If it looks like we have a matching failure, then
+		  // reset the failbit in the stream state.
+
+		  if (is.rdstate () & ios::failbit)
+		    is.clear (is.rdstate () & (~ios::failbit));
+
 		  // XXX FIXME XXX -- is this the right thing to do?
 		  // What about other streams?
 		  if (name () == "stdin")
@@ -1336,10 +1342,16 @@
 
 		if (! is)
 		  {
-		    error ("fscanf: read error");
+		    // If it looks like we have a matching failure, then
+		    // reset the failbit in the stream state.
+
+		    if (is.rdstate () & ios::failbit)
+		      is.clear (is.rdstate () & (~ios::failbit));
+		    else
+		      error ("fscanf: read error");
 
 		    // XXX FIXME XXX -- is this the right thing to do?
-
+		    // What about other streams?
 		    if (name () == "stdin")
 		      {
 			is.clear ();