diff src/file-io.cc @ 2609:12bc9d0a50b5

[project @ 1997-01-18 00:17:36 by jwe]
author jwe
date Sat, 18 Jan 1997 00:17:37 +0000
parents 9705ea40f0a2
children 8125b6f9c134
line wrap: on
line diff
--- a/src/file-io.cc	Sat Jan 18 00:13:08 1997 +0000
+++ b/src/file-io.cc	Sat Jan 18 00:17:37 1997 +0000
@@ -168,12 +168,25 @@
 
   if (nargin == 1)
     {
-      octave_stream *os = octave_stream_list::lookup (args(0));
+      // XXX FIXME XXX -- any way to avoid special case for stdout?
+
+      int fid = octave_stream_list::get_file_number (args (0));
+
+      if (fid == 1)
+	{
+	  flush_octave_stdout ();
 
-      if (os)
-	retval = (double) os->flush ();
+	  retval = 0.0;
+	}
       else
-	gripe_invalid_file_id ("fflush");
+	{
+	  octave_stream *os = octave_stream_list::lookup (fid);
+
+	  if (os)
+	    retval = (double) os->flush ();
+	  else
+	    gripe_invalid_file_id ("fflush");
+	}
     }
   else
     print_usage ("fflush");