Mercurial > hg > octave-lojdl
changeset 12061:9b9aaacf194d release-3-2-x
dlmread: perform tilde expansion to filename argument
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 23 Aug 2009 11:09:17 +0200 |
parents | aff7a8e7d8b9 |
children | 26fb50dc7401 |
files | src/ChangeLog src/DLD-FUNCTIONS/dlmread.cc |
diffstat | 2 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-08-10 John W. Eaton <jwe@octave.org> + + * DLD-FUNCTIONS/dlmread.cc (Fdlmread): Perform tilde expansion on + filename argument. + 2009-06-11 John W. Eaton <jwe@octave.org> * display.h (display_info::no_window_system): New static function.
--- a/src/DLD-FUNCTIONS/dlmread.cc +++ b/src/DLD-FUNCTIONS/dlmread.cc @@ -30,6 +30,7 @@ #include <cctype> #include <fstream> +#include "file-ops.h" #include "lo-ieee.h" #include "defun-dld.h" @@ -187,7 +188,9 @@ if (error_state) return retval; - std::ifstream file (fname.c_str ()); + std::string tname = file_ops::tilde_expand (fname); + + std::ifstream file (tname.c_str ()); if (!file) { error ("dlmread: unable to open file `%s'", fname.c_str ());