# HG changeset patch # User jwe # Date 1056482928 0 # Node ID 0a59e4de215e340b20bc3070465f2a01db521e69 # Parent 689f730954b3f4a0013a205da94bb0732e44542e [project @ 2003-06-24 19:28:48 by jwe] diff --git a/liboctave/Array2-idx.h b/liboctave/Array2-idx.h --- a/liboctave/Array2-idx.h +++ b/liboctave/Array2-idx.h @@ -74,7 +74,7 @@ // Fast magic colon processing. int result_nr = nr * nc; - int result_nc = result_nr ? 1 : 0; + int result_nc = 1; retval = Array2 (*this, result_nr, result_nc); } diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2003-06-24 John W. Eaton + + * Array2-idx.h (Array2::index (idx_vector&, int, const T&)): + Magic colon indexing always produces an object with one column. + 2003-06-21 Paul Kienzle * kpse-xfns.h (NAME_BEGINS_WITH_DEVICE): Arg is std::string, not char*. diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2003-06-24 John W. Eaton + * pt-mat.cc (tm_row_const::init, tm_const::init): Don't ignore + empty matrices that have one non-zero dimension. + + * variables.cc (symbol_exist): Use dir_path::find_first_of to + search for .oct and .m files. + * ov-base.cc (octave_base_value::subsasgn): Also allow type conversion for empty numeric objects with more than one index. * ov-base-mat.cc (octave_base_matrix::subsasgn): Likewise. diff --git a/src/pt-mat.cc b/src/pt-mat.cc --- a/src/pt-mat.cc +++ b/src/pt-mat.cc @@ -189,7 +189,7 @@ int this_elt_nr = tmp.rows (); int this_elt_nc = tmp.columns (); - if (this_elt_nr == 0 || this_elt_nc == 0) + if (this_elt_nr == 0 && this_elt_nc == 0) { if (Vempty_list_elements_ok < 0) eval_warning ("empty matrix found in matrix list", @@ -358,7 +358,7 @@ int this_elt_nr = elt.rows (); int this_elt_nc = elt.cols (); - if (this_elt_nr == 0 || this_elt_nc == 0) + if (this_elt_nr == 0 && this_elt_nc == 0) { if (Vempty_list_elements_ok < 0) warning ("empty matrix found in matrix list"); diff --git a/src/variables.cc b/src/variables.cc --- a/src/variables.cc +++ b/src/variables.cc @@ -603,21 +603,24 @@ if (! retval) { - std::string file_name = fcn_file_in_path (name); + string_vector names (2); - if ((type == "any" || type == "file") && ! file_name.empty ()) - { - retval = 2; - } - } + names(0) = name + ".oct"; + names(1) = name + ".m"; + + std::string file_name = Vload_path_dir_path.find_first_of (names); + + size_t len = file_name.length (); - if (! retval) - { - std::string file_name = oct_file_in_path (name); - - if ((type == "any" || type == "file") && ! file_name.empty ()) + if (! file_name.empty ()) { - retval = 3; + if (type == "any" || type == "file") + { + if (file_name.substr (len-4) == ".oct") + retval = 3; + else + retval = 2; + } } }