src/ov-fcn-inline.cc
changeset 7685 34b75a47e712
parent 7509 ad9e3e3293ba
     1.1 --- a/src/ov-fcn-inline.cc	Tue May 06 13:15:43 2008 -0400
     1.2 +++ b/src/ov-fcn-inline.cc	Wed Mar 18 15:23:14 2009 +0100
     1.3 @@ -47,6 +47,7 @@
     1.4  #include "ls-oct-ascii.h"
     1.5  #include "ls-hdf5.h"
     1.6  #include "ls-utils.h"
     1.7 +#include "ls-ascii-helper.h"
     1.8  
     1.9  DEFINE_OCTAVE_ALLOCATOR (octave_fcn_inline);
    1.10  
    1.11 @@ -139,27 +140,20 @@
    1.12  	nm = "";
    1.13  
    1.14        char c;
    1.15 -      std::ostringstream buf;
    1.16 +      std::string buf;
    1.17  
    1.18        // Skip preceeding newline(s)
    1.19 -      while (is.get (c) && c == '\n');
    1.20 +      skip_preceeding_newline (is);
    1.21  
    1.22        if (is)
    1.23  	{
    1.24 -	  buf << c;
    1.25  
    1.26  	  // Get a line of text whitespace characters included, leaving
    1.27  	  // newline in the stream
    1.28 -	  while (is.peek () != '\n')
    1.29 -	    {
    1.30 -	      is.get (c);
    1.31 -	      if (! is)
    1.32 -		break;
    1.33 -	      buf << c;
    1.34 -	    }
    1.35 +	  buf = read_until_newline (is, true);
    1.36  	}
    1.37  
    1.38 -      iftext = buf.str ();
    1.39 +      iftext = buf;
    1.40  
    1.41        octave_fcn_inline tmp (iftext, ifargs, nm);
    1.42        fcn = tmp.fcn;