# HG changeset patch # User Jaroslav Hajek # Date 1222759183 -7200 # Node ID 7317840e4cffcf09b9fc50d30a97e92922514bec # Parent 0d37c99fc06faa560de017f367ff4ffa92b97a2f fix empty string assignment diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -0,0 +1,4 @@ +2008-09-30 Jaroslav Hajek + + * string/split.m: New tests. + diff --git a/scripts/strings/split.m b/scripts/strings/split.m --- a/scripts/strings/split.m +++ b/scripts/strings/split.m @@ -107,3 +107,8 @@ %!error split ("foo", "bar", 3, 4); +%!assert (all (strcmp (split("road//to/hell","/"), ["road"; " "; "to "; "hell"]))) + +%!assert (all (strcmp (split("/road/to/hell/","/"), [" "; "road"; "to "; "hell"; " "]))) + + diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -0,0 +1,5 @@ +2008-09-30 Jaroslav Hajek + + * ov-str-mat.h (octave-char-matrix-str::assign): Remove declaration. + * ov-str-mat.cc (octave-char-matrix-str::assign): Remove definition. + diff --git a/src/ov-str-mat.cc b/src/ov-str-mat.cc --- a/src/ov-str-mat.cc +++ b/src/ov-str-mat.cc @@ -133,23 +133,6 @@ } return retval; -} - -void -octave_char_matrix_str::assign (const octave_value_list& idx, - const charMatrix& rhs) -{ - octave_idx_type len = idx.length (); - - // FIXME - charMatrix tmp = rhs; - if (tmp.rows () == 1 && tmp.columns () == 0) - tmp.resize (0, 0); - - for (octave_idx_type i = 0; i < len; i++) - matrix.set_index (idx(i).index_vector ()); - - ::assign (matrix, tmp, Vstring_fill_char); } octave_value diff --git a/src/ov-str-mat.h b/src/ov-str-mat.h --- a/src/ov-str-mat.h +++ b/src/ov-str-mat.h @@ -90,8 +90,6 @@ octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false) { return do_index_op_internal (idx, resize_ok); } - - void assign (const octave_value_list& idx, const charMatrix& rhs); octave_value reshape (const dim_vector& new_dims) const { return octave_value (charNDArray (matrix.reshape (new_dims)), true); }