changeset 9109:978c863bc8e5

Treat possible trailing singleton for creation of cell array from column structure vector
author David Bateman <dbateman@free.fr>
date Sat, 11 Apr 2009 16:05:16 +0200
parents b2459d21a207
children 22ae6b3411a7
files src/ChangeLog src/ov-cell.cc
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Apr 11 14:06:57 2009 +0200
+++ b/src/ChangeLog	Sat Apr 11 16:05:16 2009 +0200
@@ -1,3 +1,8 @@
+2008-04-11  David Bateman  <dbateman@free.fr>
+
+	* ov-cell.cc (Fstruct2cell): Treat possible trailing singleton for
+	creation of cell array from column structure vector.
+
 2009-04-09  Jaroslav Hajek  <highegg@gmail.com>
 
 	* ov-cell.cc (octave_cell::subsasgn): Fix reference counting
--- a/src/ov-cell.cc	Sat Apr 11 14:06:57 2009 +0200
+++ b/src/ov-cell.cc	Sat Apr 11 16:05:16 2009 +0200
@@ -1358,9 +1358,13 @@
 
 	  // The resulting dim_vector should have dimensions:
 	  // [numel(fields) size(struct)]
+	  // except if the struct is a column vector.
 
 	  dim_vector result_dv;
-	  result_dv.resize (m_dv.length () + 1); // Add 1 for the fields.
+	  if (m_dv (m_dv.length () - 1) == 1)
+	      result_dv.resize (m_dv.length ());
+	  else
+	      result_dv.resize (m_dv.length () + 1); // Add 1 for the fields.
 
 	  result_dv(0) = num_fields;