Mercurial > hg > octave-lyh
changeset 5979:8c35d219139d
[project @ 2006-09-01 18:00:01 by jwe]
author | jwe |
---|---|
date | Fri, 01 Sep 2006 18:00:02 +0000 |
parents | 32cef2cfc9c9 |
children | 45f612d96d0e |
files | src/ChangeLog src/dirfns.cc |
diffstat | 2 files changed, 8 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2006-09-01 John W. Eaton <jwe@octave.org> + + * dirfns.cc: Don't handle nargout == 0 as a special case. + (octave_change_to_directory): Perform tilde expansion on directory + name here. + 2006-08-30 John W. Eaton <jwe@octave.org> * load-save.cc (get_file_format): Fix misplaced #endif.
--- a/src/dirfns.cc +++ b/src/dirfns.cc @@ -72,7 +72,7 @@ static int octave_change_to_directory (const std::string& newdir) { - int cd_ok = octave_env::chdir (newdir); + int cd_ok = octave_env::chdir (file_ops::tilde_expand (newdir)); if (cd_ok) { @@ -223,21 +223,7 @@ @seealso{dir, ls}\n\ @end deftypefn") { - octave_value retval; - - std::string directory = octave_env::getcwd (); - - if (directory.empty ()) - warning ("pwd: can't find working directory!"); - else - { - if (nargout == 0) - octave_stdout << directory << "\n"; - else - retval = directory; - } - - return retval; + return octave_value (octave_env::getcwd ()); } DEFUN (readdir, args, ,