From: Fred Fish Date: Tue, 18 Feb 1992 01:20:46 +0000 (+0000) Subject: * readline.c (readline_default_bindings): Only make use of VLNEXT X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5bb14552fd72c35dbb19390548af08c44608aad2;p=binutils-gdb.git * readline.c (readline_default_bindings): Only make use of VLNEXT when both VLNEXT and TERMIOS_TTY_DRIVER is defined. On SVR4 includes , so VLNEXT is always defined. * sysdep-norm.h (_POSIX_VERSION): Define this for all SVR4 systems so that gets used, instead of . --- diff --git a/readline/ChangeLog b/readline/ChangeLog index 825bcac1f80..e0ad03bade6 100644 --- a/readline/ChangeLog +++ b/readline/ChangeLog @@ -1,3 +1,12 @@ +Mon Feb 17 17:15:09 1992 Fred Fish (fnf at cygnus.com) + + * readline.c (readline_default_bindings): Only make use of VLNEXT + when both VLNEXT and TERMIOS_TTY_DRIVER is defined. On SVR4 + includes , so VLNEXT is always defined. + + * sysdep-norm.h (_POSIX_VERSION): Define this for all SVR4 + systems so that gets used, instead of . + Fri Dec 20 12:04:31 1991 Fred Fish (fnf at cygnus.com) * configure.in: Change svr4 references to sysv4. diff --git a/readline/readline.c b/readline/readline.c index 817ef97fad0..cfe0fec4a05 100644 --- a/readline/readline.c +++ b/readline/readline.c @@ -1,7 +1,7 @@ /* readline.c -- a general facility for reading lines of input with emacs style editing and completion. */ -/* Copyright (C) 1987,1989 Free Software Foundation, Inc. +/* Copyright (C) 1987, 1989, 1991 Free Software Foundation, Inc. This file contains the Readline Library (the Library), a set of routines for providing Emacs style line input to programs that ask @@ -9,18 +9,17 @@ The Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 1, or (at your option) - any later version. + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. - The Library is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + The Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - The GNU General Public License is often shipped with GNU software, and - is generally kept in a file called COPYING or LICENSE. If you do not - have a copy of the license, write to the Free Software Foundation, - 675 Mass Ave, Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Remove these declarations when we have a complete libgnu.a. */ /* #define STATIC_MALLOC */ @@ -30,19 +29,14 @@ extern char *xmalloc (), *xrealloc (); static char *xmalloc (), *xrealloc (); #endif /* STATIC_MALLOC */ -#include +#include "sysdep.h" #include +#include #include +#ifndef NO_SYS_FILE #include -#include - -#if defined (__GNUC__) -# define alloca __builtin_alloca -#else -# if defined (sparc) || defined (HAVE_ALLOCA_H) -# include -# endif #endif +#include #if defined (HAVE_UNISTD_H) # include @@ -119,34 +113,6 @@ struct passwd *getpwuid (), *getpwent (); /* #define HACK_TERMCAP_MOTION */ -#if defined (_POSIX_VERSION) || defined (USGr3) || defined (USGr4) -# include -# define direct dirent -# if defined (_POSIX_VERSION) -# define D_NAMLEN(d) (strlen ((d)->d_name)) -# else /* !_POSIX_VERSION */ -# define D_NAMLEN(d) ((d)->d_reclen) -# endif /* !_POSIX_VERSION */ -#else /* !_POSIX_VERSION && !USGr3 */ -# define D_NAMLEN(d) ((d)->d_namlen) -# if !defined (USG) -# include -# else /* USG */ -# if defined (Xenix) -# include -# else /* !Xenix */ -# include -# endif /* !Xenix */ -# endif /* USG */ -#endif /* !POSIX_VERSION && !USGr3 */ - -#if defined (USG) && defined (TIOCGWINSZ) -# include -# if defined (USGr4) || defined (USGr3) -# include -# endif /* USGr4 */ -#endif /* USG && TIOCGWINSZ */ - /* Some standard library routines. */ #include "readline.h" #include "history.h" @@ -1226,7 +1192,7 @@ readline_default_bindings () keymap[(unsigned char)kill].type == ISFUNC) keymap[(unsigned char)kill].function = rl_unix_line_discard; -#if defined (VLNEXT) +#if defined (VLNEXT) && defined (TERMIOS_TTY_DRIVER) { int nextc; @@ -1236,7 +1202,7 @@ readline_default_bindings () keymap[(unsigned char)nextc].type == ISFUNC) keymap[(unsigned char)nextc].function = rl_quoted_insert; } -#endif /* VLNEXT */ +#endif /* VLNEXT && TERMIOS_TTY_DRIVER */ #if defined (VWERASE) { @@ -5137,7 +5103,7 @@ filename_completion_function (text, state) static char *users_dirname = (char *)NULL; static int filename_len; - struct dirent *entry = (struct dirent *)NULL; + dirent *entry = (dirent *)NULL; /* If we don't have any state, then do some initialization. */ if (!state) @@ -5203,7 +5169,7 @@ filename_completion_function (text, state) { /* Otherwise, if these match upto the length of filename, then it is a match. */ - if (((int)D_NAMLEN (entry)) >= filename_len && + if (entry->d_name[0] == filename[0] && /* Quick test */ (strncmp (filename, entry->d_name, filename_len) == 0)) { break; @@ -5227,7 +5193,7 @@ filename_completion_function (text, state) if (dirname && (strcmp (dirname, ".") != 0)) { temp = (char *) - xmalloc (1 + strlen (users_dirname) + D_NAMLEN (entry)); + xmalloc (1 + strlen (users_dirname) + strlen (entry->d_name)); strcpy (temp, users_dirname); strcat (temp, entry->d_name); } diff --git a/readline/sysdep-norm.h b/readline/sysdep-norm.h index 098665937c4..158b50406ee 100644 --- a/readline/sysdep-norm.h +++ b/readline/sysdep-norm.h @@ -20,3 +20,9 @@ extern char *alloca (); #include typedef struct dirent dirent; + +/* SVR4 systems should use rather than . */ + +#if defined (USGr4) +#define _POSIX_VERSION +#endif