diff src/ov-fcn-inline.cc @ 4988:352d228d409b

[project @ 2004-09-11 13:05:38 by jwe]
author jwe
date Sat, 11 Sep 2004 13:05:39 +0000
parents c969a018c928
children f8c27dad3643
line wrap: on
line diff
--- a/src/ov-fcn-inline.cc	Fri Sep 10 20:24:06 2004 +0000
+++ b/src/ov-fcn-inline.cc	Sat Sep 11 13:05:39 2004 +0000
@@ -31,6 +31,7 @@
 #include <config.h>
 #endif
 
+#include <istream>
 #include <iostream>
 
 #include "defun.h"
@@ -125,7 +126,31 @@
       is >> nm;
       if (nm == "0")
 	nm = "";
-      is >> iftext;
+
+      char c;
+      OSSTREAM buf;
+
+      // Skip preceeding newline(s)
+      while (is.get (c) && c == '\n');
+
+      if (is)
+	{
+	  buf << c;
+
+	  // Get a line of text whitespace characters included, leaving
+	  // newline in the stream
+	  while (is.peek () != '\n')
+	    {
+	      is.get (c);
+	      if (! is)
+		break;
+	      buf << c;
+	    }
+	}
+
+      buf << OSSTREAM_ENDS;
+      iftext = OSSTREAM_STR (buf);
+      OSSTREAM_FREEZE (buf);
 
       octave_fcn_inline tmp (iftext, ifargs, nm);
       fcn = tmp.fcn;
@@ -331,6 +356,9 @@
     }
 
   H5Dclose (data_hid);
+  H5Sclose (space_hid);
+  H5Tclose (type_hid);
+  H5Gclose (group_hid);
 
   return retval;
 }