help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sscanf


From: John W. Eaton
Subject: Re: sscanf
Date: Tue, 5 Apr 2005 11:48:48 -0400

On  5-Apr-2005, bertrand roessli <address@hidden> wrote:

| I am using GNU Octave, version 2.1.57 (i686-pc-linux-gnu). 
| so is it a kind of a bug?

Yes.  Please try the following patch.  This is relative to the current
CVS sources, but I think it will apply to other recent snapshot
versions as well.

Thanks,

jwe


src/ChangeLog:

2005-04-05  John W. Eaton  <address@hidden>

        * oct-stream.cc (BEGIN_C_CONVERSION): Clear stream state if
        we hit EOF after we read something.


Index: src/oct-stream.cc
===================================================================
RCS file: /cvs/octave/src/oct-stream.cc,v
retrieving revision 1.113
diff -u -r1.113 oct-stream.cc
--- src/oct-stream.cc   30 Mar 2005 21:13:28 -0000      1.113
+++ src/oct-stream.cc   5 Apr 2005 15:44:42 -0000
@@ -1460,6 +1460,9 @@
  \
   tbuf[n] = '\0'; \
  \
+  if (n > 0 && c == EOF) \
+    is.clear (); \
+ \
   std::string tmp = tbuf; \
  \
   delete [] tbuf



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]