# HG changeset patch # User Jaroslav Hajek # Date 1222759183 -7200 # Node ID dadf478ddc4212d7dceef3618b811bd36758d04c # Parent 17352ccd860ecda3173c8f7ca702916ac91d0ed2 fix empty string assignment diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2008-09-30 Jaroslav Hajek + + * string/split.m: New tests. + 2008-09-30 Ben Abbott * plot/__go_draw_axes__.m: Fix interpolation of facecolors. 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 @@ -1,3 +1,8 @@ +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. + 2008-09-30 John W. Eaton * DLD-FUNCTIONS/__magick_read__.cc: Only define 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 @@ -135,23 +135,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 octave_char_matrix_str::resize (const dim_vector& dv, bool fill) const { 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 @@ -91,8 +91,6 @@ 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); }