Mercurial > hg > octave-nkf
changeset 11568:de5fba8337c5
octave_value_list::all_scalars: test for scalars, not strings
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 19 Jan 2011 05:42:37 -0500 |
parents | 5c18da80e28a |
children | 7e9a111cae20 |
files | src/ChangeLog src/oct-obj.cc |
diffstat | 2 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-01-19 John W. Eaton <jwe@octave.org> + + * oct-obj.cc (octave_value_list::all_scalars): Check for scalar + values, not strings. Bug #32172. + 2011-01-17 Rik <octave@nomad.inbox5.com> * DLD-FUNCTIONS/module-files: Add quadcc.cc to list of files.
--- a/src/oct-obj.cc +++ b/src/oct-obj.cc @@ -179,11 +179,16 @@ bool octave_value_list::all_scalars (void) const { - octave_idx_type n = length (), i; + octave_idx_type n = length (); - for (i = 0; i < n && elem (i).is_string (); i++) ; + for (octave_idx_type i = 0; i < n; i++) + { + dim_vector dv = elem(i).dims (); + if (! dv.all_ones ()) + return false; + } - return i == n; + return true; } bool