Mercurial > hg > octave-lyh
changeset 1434:164051941de6
[project @ 1995-09-19 07:36:14 by jwe]
author | jwe |
---|---|
date | Tue, 19 Sep 1995 07:36:14 +0000 |
parents | b8a8821962af |
children | 611c49faddae |
files | readline/bind.c readline/complete.c readline/parens.c readline/rlconf.h readline/signals.c |
diffstat | 5 files changed, 47 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/readline/bind.c +++ b/readline/bind.c @@ -24,9 +24,9 @@ #include <stdio.h> #include <sys/types.h> #include <fcntl.h> -#if !defined (NO_SYS_FILE) +#if defined (HAVE_SYS_FILE) # include <sys/file.h> -#endif /* !NO_SYS_FILE */ +#endif /* HAVE_SYS_FILE */ #include <signal.h> #if defined (HAVE_UNISTD_H) @@ -93,9 +93,14 @@ #if defined (HAVE_STRCASECMP) #define stricmp strcasecmp +#else +static int stricmp (); +#endif + +#if defined (HAVE_STRNCASECMP) #define strnicmp strncasecmp #else -static int stricmp (), strnicmp (); +static int strnicmp (); #endif #if defined (STATIC_MALLOC)
--- a/readline/complete.c +++ b/readline/complete.c @@ -28,9 +28,9 @@ #include <stdio.h> #include <sys/types.h> #include <fcntl.h> -#if !defined (NO_SYS_FILE) +#if defined (HAVE_SYS_FILE) # include <sys/file.h> -#endif /* !NO_SYS_FILE */ +#endif /* HAVE_SYS_FILE */ #if defined (HAVE_UNISTD_H) # include <unistd.h> @@ -217,6 +217,11 @@ unless they also appear within this list. */ char *rl_completer_quote_characters = (char *)NULL; +/* Character to add after a single completion alternative matches + at the end of line. By default this is a space. + Nothing is added if this is '\0'. */ +char rl_completion_append_character = ' '; + /* List of characters that are word break characters, but should be left in TEXT when it is passed to the completion function. The shell uses this to help determine what kind of completing to do. */ @@ -742,7 +747,8 @@ If this was the only match, and we are hacking files, check the file to see if it was a directory. If so, add a '/' to the name. If not, and we are at the end - of the line, then add a space. */ + of the line, then add rl_completion_append_character, + usually a space. */ if (matches[1]) { if (what_to_do == '!') @@ -758,8 +764,11 @@ if (quote_char) temp_string[temp_string_index++] = quote_char; - temp_string[temp_string_index++] = delimiter ? delimiter : ' '; - temp_string[temp_string_index++] = '\0'; + temp_string[temp_string_index++] = delimiter ? delimiter + : rl_completion_append_character; + + if (rl_completion_append_character) + temp_string[temp_string_index++] = '\0'; if (rl_filename_completion_desired) {
--- a/readline/parens.c +++ b/readline/parens.c @@ -34,7 +34,21 @@ #else /* PAREN_MATCHING */ #include <stdio.h> +/* With SunOS 4.1.x at least, and Ultrix 4.x, sys/types.h won't define + the FD_XXX macros if _POSIX_SOURCE is defined */ +#if defined (_POSIX_SOURCE) && (defined (sun) || defined (ultrix)) +#undef _POSIX_SOURCE +#endif +/* On the Alpha, we have to have _OSF_SOURCE defined for sys/types.h + to define the FD_XXX macros. */ +#if defined (__alpha__) && ! defined (_OSF_SOURCE) +#define _OSF_SOURCE +#endif #include <sys/types.h> +/* AIX (any others?) defines the FD_XXX macros in sys/select.h */ +#if defined (HAVE_SYS_SELECT_H) +#include <sys/select.h> +#endif #if defined (FD_SET) # include <sys/time.h> #endif /* FD_SET */
--- a/readline/rlconf.h +++ b/readline/rlconf.h @@ -32,7 +32,7 @@ /* If defined, readline shows opening parens and braces when closing paren or brace entered. */ -/* #define PAREN_MATCHING */ +#define PAREN_MATCHING /* This definition is needed by readline.c, rltty.c, and signals.c. */ /* If on, then readline handles signals in a way that doesn't screw. */
--- a/readline/signals.c +++ b/readline/signals.c @@ -24,9 +24,9 @@ #include <stdio.h> #include <sys/types.h> #include <fcntl.h> -#if !defined (NO_SYS_FILE) +#if defined (HAVE_SYS_FILE) # include <sys/file.h> -#endif /* !NO_SYS_FILE */ +#endif /* HAVE_SYS_FILE */ #include <signal.h> #if defined (HAVE_UNISTD_H) @@ -64,15 +64,10 @@ extern void free_undo_list (); -#if defined (VOID_SIGHANDLER) -# define sighandler void -#else -# define sighandler int -#endif /* VOID_SIGHANDLER */ - /* This typedef is equivalant to the one for Function; it allows us to say SigHandler *foo = signal (SIGKILL, SIG_IGN); */ -typedef sighandler SigHandler (); +typedef RETSIGTYPE SigHandler (); + #if defined (__GO32__) # undef HANDLE_SIGNALS @@ -94,7 +89,7 @@ #if defined (SIGWINCH) static SigHandler *old_sigwinch = (SigHandler *)NULL; -static sighandler +static RETSIGTYPE rl_handle_sigwinch (sig) int sig; { @@ -108,9 +103,9 @@ old_sigwinch != (SigHandler *)SIG_IGN && old_sigwinch != (SigHandler *)SIG_DFL) (*old_sigwinch) (sig); -#if !defined (VOID_SIGHANDLER) +#if RETSIGTYPE != void return (0); -#endif /* VOID_SIGHANDLER */ +#endif } #endif /* SIGWINCH */ @@ -128,7 +123,7 @@ #endif /* !SHELL */ /* Handle an interrupt character. */ -static sighandler +static RETSIGTYPE rl_signal_handler (sig) int sig; { @@ -198,9 +193,9 @@ rl_set_signals (); } -#if !defined (VOID_SIGHANDLER) +#if RETSIGTYPE != void return (0); -#endif /* !VOID_SIGHANDLER */ +#endif } #if defined (HAVE_POSIX_SIGNALS)