Mercurial > hg > octave-terminal
changeset 3970:4f884e25aab9
[project @ 2002-07-02 04:14:35 by jwe]
author | jwe |
---|---|
date | Tue, 02 Jul 2002 04:14:36 +0000 |
parents | 47972b28e85e |
children | 41e7fa40ff4c |
files | liboctave/ChangeLog liboctave/cmd-edit.cc liboctave/lo-utils.cc liboctave/lo-utils.h |
diffstat | 4 files changed, 21 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2002-07-01 John W. Eaton <jwe@bevo.che.wisc.edu> + + * lo-utils.cc (octave_fgetl): New function. + * cmd-edit.cc (do_readline): Use it instead of octave_fgets. + 2002-05-24 John W. Eaton <jwe@bevo.che.wisc.edu> * LSODE.cc (LSODE::error_message): New function.
--- a/liboctave/cmd-edit.cc +++ b/liboctave/cmd-edit.cc @@ -478,7 +478,7 @@ fprintf (output_stream, prompt.c_str ()); fflush (output_stream); - return octave_fgets (input_stream); + return octave_fgetl (input_stream); } void
--- a/liboctave/lo-utils.cc +++ b/liboctave/lo-utils.cc @@ -162,6 +162,19 @@ return retval; } +std::string +octave_fgetl (FILE *f) +{ + std::string retval = octave_fgets (f); + + size_t len = retval.length (); + + if (retval[len-1] == '\n') + retval.resize (len-1); + + return retval; +} + /* ;;; Local Variables: *** ;;; mode: C++ ***