Mercurial > hg > octave-lojdl
changeset 6200:1ec9de3cd12c
[project @ 2006-12-05 18:05:11 by jwe]
author | jwe |
---|---|
date | Tue, 05 Dec 2006 18:05:12 +0000 |
parents | 7f7f612eac06 |
children | 42efaffa4f08 |
files | src/ChangeLog src/dirfns.cc src/pt-mat.cc test/test_system.m |
diffstat | 4 files changed, 18 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2006-12-05 John W. Eaton <jwe@octave.org> + + * pt-mat.cc (tm_row_const::empty): New function. + (tm_const::init): Don't append anything if tmp tm_row_const object + is empty. + (tree_matrix::rvalue): Default return value is Matrix(). + Don't do anything if tmp tm_const object is empty. + + * dirfns.cc (Fmkdir): Fix thinko in previous change. + 2006-12-05 Paul Kienzle <pkienzle@users.sf.net> * DLD-FUNCTIONS/rand.cc: Test for Poisson generator with lambda > 1e8.
--- a/src/dirfns.cc +++ b/src/dirfns.cc @@ -237,7 +237,7 @@ else dirname = parent + file_ops::dir_sep_char + dir; } - else + else if (nargin == 1) { dirname = args(0).string_value (); @@ -253,7 +253,7 @@ std::string msg; int status = file_ops::mkdir (file_ops::tilde_expand (dirname), - 0777, msg); + 0777, msg); if (status < 0) {
--- a/src/pt-mat.cc +++ b/src/pt-mat.cc @@ -156,6 +156,8 @@ octave_idx_type rows (void) { return rep->dv(0); } octave_idx_type cols (void) { return rep->dv(1); } + bool empty (void) const { return rep->empty (); } + dim_vector dims (void) { return rep->dv; } bool all_strings_p (void) const { return rep->all_str; } @@ -511,7 +513,7 @@ tm_row_const tmp (*elt); - if (tmp) + if (tmp && ! tmp.empty ()) { if (all_str && ! tmp.all_strings_p ()) all_str = false; @@ -758,7 +760,7 @@ octave_value tree_matrix::rvalue (void) { - octave_value retval; + octave_value retval = Matrix (); bool all_strings_p = false; bool all_sq_strings_p = false; @@ -771,7 +773,7 @@ tm_const tmp (*this); - if (tmp) + if (tmp && ! tmp.empty ()) { dim_vector dv = tmp.dims (); all_strings_p = tmp.all_strings_p ();
--- a/test/test_system.m +++ b/test/test_system.m @@ -239,7 +239,7 @@ %!error <Invalid call to mkdir.*> mkdir (); %% test/octave.test/system/mkdir-2.m -%!error <Invalid call to mkdir.*> mkdir ("foo", 1); +%!error <Invalid call to mkdir.*> mkdir ("foo", 1, 2); %% test/octave.test/system/rmdir-1.m %!error <Invalid call to rmdir.*> rmdir ();