Mercurial > hg > octave-avbm
changeset 1592:992d524aefb4
[project @ 1995-10-31 10:24:35 by jwe]
author | jwe |
---|---|
date | Tue, 31 Oct 1995 10:24:35 +0000 |
parents | 57e84c10c558 |
children | 2790524e1932 |
files | src/dirfns.cc |
diffstat | 1 files changed, 10 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/dirfns.cc +++ b/src/dirfns.cc @@ -453,7 +453,7 @@ DEFALIAS (dir, ls); -DEFUN ("pwd", Fpwd, Spwd, 00, +DEFUN ("pwd", Fpwd, Spwd, 01, "pwd (): print current working directory") { Octave_object retval; @@ -477,10 +477,16 @@ if (directory) { - char *s = strconcat (directory, "\n"); - retval = s; - delete [] s; + if (nargout == 0) + { + ostrstream output_buf; + output_buf << directory << "\n" << ends; + maybe_page_output (output_buf); + } + else + retval = directory; } + return retval; }