Mercurial > hg > octave-nkf
diff src/ov-struct.cc @ 5433:2f51d6d65fb2
[project @ 2005-08-30 15:20:30 by jwe]
author | jwe |
---|---|
date | Tue, 30 Aug 2005 15:20:30 +0000 |
parents | f9ab8e67ce7a |
children | 781c9e7dbb73 |
line wrap: on
line diff
--- a/src/ov-struct.cc +++ b/src/ov-struct.cc @@ -1026,15 +1026,20 @@ break; // Try for some backward compatibility... - Cell tcell = t2.is_cell () ? t2.cell_value () : Cell (t2); - - if (error_state) + if (t2.is_cell () && t2.length() > 1) + m.assign (nm, t2); + else { - error ("load: internal error loading struct elements"); - return false; + Cell tcell = t2.is_cell () ? t2.cell_value () : Cell (t2); + + if (error_state) + { + error ("load: internal error loading struct elements"); + return false; + } + + m.assign (nm, tcell); } - - m.assign (nm, tcell); } if (is) @@ -1111,15 +1116,20 @@ break; // Try for some backward compatibility... - Cell tcell = t2.is_cell () ? t2.cell_value () : Cell (t2); - - if (error_state) + if (t2.is_cell () && t2.length() > 1) + m.assign (nm, t2); + else { - error ("load: internal error loading struct elements"); - return false; + Cell tcell = t2.is_cell () ? t2.cell_value () : Cell (t2); + + if (error_state) + { + error ("load: internal error loading struct elements"); + return false; + } + + m.assign (nm, tcell); } - - m.assign (nm, tcell); } if (is) @@ -1197,16 +1207,21 @@ octave_value t2 = dsub.tc; // Try for some backward compatibility... - Cell tcell = t2.is_cell () ? t2.cell_value () : Cell (t2); - - if (error_state) + if (t2.is_cell () && t2.length() > 1) + m.assign (dsub.name, t2); + else { - error ("load: internal error loading struct elements"); - return false; + Cell tcell = t2.is_cell () ? t2.cell_value () : Cell (t2); + + if (error_state) + { + error ("load: internal error loading struct elements"); + return false; + } + + m.assign (dsub.name, tcell); } - m.assign (dsub.name, tcell); - if (have_h5giterate_bug) current_item++; // H5Giterate returned the last index processed }