# HG changeset patch # User Rik # Date 1417933592 28800 # Node ID 68116bea38baf5e8a0e53cd8652bc74ea939c94e # Parent aea099cd1ee751206b932c4320686ba3aec9641f Avoid duplicate error message when concatenating cell arrays with dim mismatch. * pt-mat.cc (tm_row_const::tm_row_const_rep::init): Check error state before continuing to process concatenation. Previous dimension check may already have printed a warning and set error_state variable. diff -r aea099cd1ee7 -r 68116bea38ba libinterp/parse-tree/pt-mat.cc --- a/libinterp/parse-tree/pt-mat.cc Thu Oct 09 20:01:09 2014 +0200 +++ b/libinterp/parse-tree/pt-mat.cc Sat Dec 06 22:26:32 2014 -0800 @@ -387,27 +387,30 @@ first_elem = true; - for (iterator p = begin (); p != end (); p++) + if (! error_state) { - octave_quit (); - - octave_value val = *p; - - dim_vector this_elt_dv = val.dims (); - - if (! this_elt_dv.zero_by_zero ()) + for (iterator p = begin (); p != end (); p++) { - all_mt = false; + octave_quit (); + + octave_value val = *p; - if (first_elem) + dim_vector this_elt_dv = val.dims (); + + if (! this_elt_dv.zero_by_zero ()) { - first_elem = false; - dv = this_elt_dv; - } - else if ((! any_class) && (! dv.hvcat (this_elt_dv, 1))) - { - eval_error ("horizontal dimensions mismatch", dv, this_elt_dv); - break; + all_mt = false; + + if (first_elem) + { + first_elem = false; + dv = this_elt_dv; + } + else if ((! any_class) && (! dv.hvcat (this_elt_dv, 1))) + { + eval_error ("horizontal dimensions mismatch", dv, this_elt_dv); + break; + } } } }