changeset 5870:a0218194daa6

[project @ 2006-06-30 15:50:40 by jwe]
author jwe
date Fri, 30 Jun 2006 15:50:40 +0000
parents 6a23ee71dd86
children b9fd54407c8d
files liboctave/ChangeLog liboctave/data-conv.cc
diffstat 2 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog	Thu Jun 29 18:04:21 2006 +0000
+++ b/liboctave/ChangeLog	Fri Jun 30 15:50:40 2006 +0000
@@ -1,3 +1,8 @@
+2006-06-30  John W. Eaton  <jwe@octave.org>
+
+	* data-conv.cc (data_conv::string_to_data_type):
+	Correctly handle leading "*".
+
 2006-06-29  Atsushi Kajita  <a-kajita@mizar.freemail.ne.jp>
 
 	* Sparse.cc (Sparse<T>::SparseRep::elem): Avoid out of bounds
--- a/liboctave/data-conv.cc	Thu Jun 29 18:04:21 2006 +0000
+++ b/liboctave/data-conv.cc	Fri Jun 30 15:50:40 2006 +0000
@@ -297,15 +297,21 @@
     {
       if (s[pos+1] == '>')
 	{
+	  std::string s1;
+
 	  if (input_is_output)
 	    {
 	      input_is_output = false;
 
+	      s1 = s.substr (1, pos-1);
+
 	      (*current_liboctave_warning_handler)
 		("warning: ignoring leading * in fread precision");
 	    }
+	  else
+	    s1 = s.substr (0, pos);
 
-	  input_type = string_to_data_type (s.substr (0, pos));
+	  input_type = string_to_data_type (s1);
 	  output_type = string_to_data_type (s.substr (pos+2));
 	}
       else
@@ -314,6 +320,9 @@
     }
   else
     {
+      if (input_is_output)
+	s = s.substr (1);
+
       input_type = string_to_data_type (s);
 
       if (input_is_output)