Mercurial > hg > octave-thorsten
changeset 1430:045e70a15a8f
[project @ 1995-09-19 07:05:37 by jwe]
author | jwe |
---|---|
date | Tue, 19 Sep 1995 07:09:50 +0000 |
parents | 245206fbed64 |
children | d90d88618a9e |
files | src/Map.h src/input.cc src/pt-const.cc src/sysdep.cc |
diffstat | 4 files changed, 28 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/src/Map.h +++ b/src/Map.h @@ -37,9 +37,9 @@ #if ! defined (octave_Map_h) #define octave_Map_h 1 -#include <Pix.h> +#include <cstring> -#include "utils.h" +#include <Pix.h> template <class C> class Map @@ -88,9 +88,11 @@ CHNode (void) : tl (0), hd (0) { } - CHNode (const char *h, const C& c, CHNode *t = 0) - : tl (t), cont (c) - { hd = strsave (h); } + CHNode (const char *h, const C& c, CHNode *t = 0) : tl (t), cont (c) + { + hd = h ? strcpy (new char [strlen (h) + 1], h) : 0; + } + ~CHNode (void) { delete [] hd; }
--- a/src/input.cc +++ b/src/input.cc @@ -704,6 +704,8 @@ return names; } +// XXX FIXME XXX -- make this generate file names when appropriate. + static char ** generate_possible_completions (const char *text, char *& prefix, char *& hint) @@ -712,13 +714,10 @@ prefix = 0; - if (text && *text && *text != '.') - { - if (strrchr (text, '.')) - names = generate_struct_completions (text, prefix, hint); - else - names = make_name_list (); - } + if (text && *text && *text != '.' && strrchr (text, '.')) + names = generate_struct_completions (text, prefix, hint); + else + names = make_name_list (); return names; } @@ -847,7 +846,8 @@ if (matches == 1 && looks_like_struct (buf)) rl_completion_append_character = '.'; else - rl_completion_append_character = ' '; + rl_completion_append_character + = user_pref.completion_append_char; return buf; } @@ -911,7 +911,6 @@ operate_and_get_next (int count, int c) { int where; - extern int history_stifled, history_length, max_input_history; // Accept the current line. @@ -921,7 +920,8 @@ where = where_history (); - if (history_stifled && (history_length >= max_input_history)) + if ((history_is_stifled () && (history_length >= max_input_history)) + || (where >= history_length - 1)) saved_history_line_to_use = where; else saved_history_line_to_use = where + 1;
--- a/src/pt-const.cc +++ b/src/pt-const.cc @@ -41,6 +41,7 @@ #include "pager.h" #include "tree-const.h" #include "user-prefs.h" +#include "utils.h" // The following three variables could be made static members of the // tree_constant class.
--- a/src/sysdep.cc +++ b/src/sysdep.cc @@ -45,6 +45,16 @@ #include <unistd.h> #endif +#if defined (HAVE_TERMIOS_H) +#include <termios.h> +#elif defined (HAVE_TERMIO_H) +#include <termio.h> +#elif defined (HAVE_SGTTY_H) +#include <sgtty.h> +#else +LOSE! LOSE! +#endif + #include "defun.h" #include "error.h" #include "f77-uscore.h" @@ -63,16 +73,6 @@ extern char *term_clrpag; extern void _rl_output_character_function (); -#if defined (HAVE_TERMIOS_H) -#include <termios.h> -#elif defined (HAVE_TERMIO_H) -#include <termio.h> -#elif defined (HAVE_SGTTY_H) -#include <sgtty.h> -#else -LOSE! LOSE! -#endif - extern double F77_FCN (d1mach, D1MACH) (const int&); }