diff liboctave/lo-utils.cc @ 4527:c0a23a13eea2

[project @ 2003-10-03 02:52:46 by jwe]
author jwe
date Fri, 03 Oct 2003 02:52:46 +0000
parents 7d9bda865012
children 743ef6154f8a
line wrap: on
line diff
--- a/liboctave/lo-utils.cc	Thu Oct 02 18:33:59 2003 +0000
+++ b/liboctave/lo-utils.cc	Fri Oct 03 02:52:46 2003 +0000
@@ -105,6 +105,15 @@
 std::string
 octave_fgets (FILE *f)
 {
+  bool eof;
+  return octave_fgets (f, eof);
+}
+
+std::string
+octave_fgets (FILE *f, bool& eof)
+{
+  eof = false;
+
   std::string retval;
 
   int grow_size = 1024;
@@ -147,6 +156,8 @@
 	{
 	  if (len == 0)
 	    {
+	      eof = true;
+
 	      free (buf);
 
 	      buf = 0;
@@ -166,7 +177,14 @@
 std::string
 octave_fgetl (FILE *f)
 {
-  std::string retval = octave_fgets (f);
+  bool eof;
+  return octave_fgetl (f, eof);
+}
+
+std::string
+octave_fgetl (FILE *f, bool& eof)
+{
+  std::string retval = octave_fgets (f, eof);
 
   size_t len = retval.length ();