# HG changeset patch # User David Bateman # Date 1239458716 -7200 # Node ID 978c863bc8e5d983cfad9329742a8b941b4879fb # Parent b2459d21a2070fc3af1e9f2e77e51b9b9b2ef6e9 Treat possible trailing singleton for creation of cell array from column structure vector diff -r b2459d21a207 -r 978c863bc8e5 src/ChangeLog --- 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 + + * ov-cell.cc (Fstruct2cell): Treat possible trailing singleton for + creation of cell array from column structure vector. + 2009-04-09 Jaroslav Hajek * ov-cell.cc (octave_cell::subsasgn): Fix reference counting diff -r b2459d21a207 -r 978c863bc8e5 src/ov-cell.cc --- 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;