# HG changeset patch # User jwe # Date 941680294 0 # Node ID 9c782a34b545bf3dcbc360f06afc18b0f5666c81 # Parent 08ad797989f81e42bcb4206a4af8fe98d244fe35 [project @ 1999-11-04 01:51:34 by jwe] diff -r 08ad797989f8 -r 9c782a34b545 src/ChangeLog --- a/src/ChangeLog Wed Nov 03 21:41:35 1999 +0000 +++ b/src/ChangeLog Thu Nov 04 01:51:34 1999 +0000 @@ -1,3 +1,10 @@ +1999-11-03 John W. Eaton + + * oct-stream.cc (octave_base_stream::do_scanf): If it looks like + we have a matching failure, then reset the failbit in the stream + state. + (octave_base_stream::do_oscanf): Likewise. + 1999-11-02 Ben Sapp * src/help.cc (Fhelp): Texinfoize doc string. diff -r 08ad797989f8 -r 9c782a34b545 src/oct-stream.cc --- a/src/oct-stream.cc Wed Nov 03 21:41:35 1999 +0000 +++ b/src/oct-stream.cc Thu Nov 04 01:51:34 1999 +0000 @@ -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 ();