Mercurial > hg > octave-max
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 +++ b/src/ChangeLog @@ -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 +++ b/src/ov-cell.cc @@ -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;