diff options
author | ache <ache@FreeBSD.org> | 1994-05-14 01:18:07 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1994-05-14 01:18:07 +0000 |
commit | 0aad240af7b208ff858b3cf900ada0beb8e2446d (patch) | |
tree | d36fc1ddecbbedebc02f4fd55112adc46caaaf6a /gnu/lib/libreadline | |
parent | b772d1e49f137fdb0f34072572aa6ccdf24f61a2 (diff) | |
download | FreeBSD-src-0aad240af7b208ff858b3cf900ada0beb8e2446d.zip FreeBSD-src-0aad240af7b208ff858b3cf900ada0beb8e2446d.tar.gz |
Make local changes more portable.
Diffstat (limited to 'gnu/lib/libreadline')
-rw-r--r-- | gnu/lib/libreadline/Makefile | 5 | ||||
-rw-r--r-- | gnu/lib/libreadline/README.FreeBSD | 2 | ||||
-rw-r--r-- | gnu/lib/libreadline/bind.c | 49 | ||||
-rw-r--r-- | gnu/lib/libreadline/rltty.c | 9 |
4 files changed, 61 insertions, 4 deletions
diff --git a/gnu/lib/libreadline/Makefile b/gnu/lib/libreadline/Makefile index 7193879..faedac2 100644 --- a/gnu/lib/libreadline/Makefile +++ b/gnu/lib/libreadline/Makefile @@ -1,12 +1,11 @@ -# $Id: Makefile,v 1.7 1994/05/11 16:30:27 ache Exp $ +# $Id: Makefile,v 1.8 1994/05/13 15:47:02 ache Exp $ SHLIB_MAJOR=1 SHLIB_MINOR=0 CFLAGS+= -I${.CURDIR} -I${.CURDIR}/readline -DVOID_SIGHANDLER \ -DHAVE_UNISTD_H -DHAVE_STRING_H -DHAVE_STDLIB_H -DHAVE_VARARGS_H \ - -DFreeBSD \ - -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp + -DFreeBSD LIB= readline SRCS+= readline.c funmap.c keymaps.c vi_mode.c parens.c \ diff --git a/gnu/lib/libreadline/README.FreeBSD b/gnu/lib/libreadline/README.FreeBSD index 9e1829c..6af2775 100644 --- a/gnu/lib/libreadline/README.FreeBSD +++ b/gnu/lib/libreadline/README.FreeBSD @@ -11,6 +11,8 @@ Workaround for this implemented via TIOCGWINSZ/TIOCSWINSZ with same winsize structure: it does nothing expect polling process from background. Look tcsh_hack.readme for details. +This version is more ctype-oriented than original bash version. + If you want 8-bit clean version, put set convert-meta off set output-meta on diff --git a/gnu/lib/libreadline/bind.c b/gnu/lib/libreadline/bind.c index 16dbdba..9e91a9c 100644 --- a/gnu/lib/libreadline/bind.c +++ b/gnu/lib/libreadline/bind.c @@ -87,6 +87,13 @@ extern char **rl_funmap_names (); void rl_set_keymap_from_edit_mode (); static int glean_key_from_name (); +#if !defined (BSD386) && !defined (NetBSD) && \ + !defined (FreeBSD) && !defined (_386BSD) +static int stricmp (), strnicmp (); +#else +#define stricmp strcasecmp +#define strnicmp strncasecmp +#endif #if defined (STATIC_MALLOC) static char *xmalloc (), *xrealloc (); @@ -1411,6 +1418,48 @@ substring_member_of_array (string, array) return (0); } +#if !defined (BSD386) && !defined (NetBSD) && \ + !defined (FreeBSD) && !defined (_386BSD) +/* Whoops, Unix doesn't have strnicmp. */ + +/* Compare at most COUNT characters from string1 to string2. Case + doesn't matter. */ +static int +strnicmp (string1, string2, count) + char *string1, *string2; + int count; +{ + register char ch1, ch2; + + while (count) + { + ch1 = *string1++; + ch2 = *string2++; + if (to_upper(ch1) == to_upper(ch2)) + count--; + else break; + } + return (count); +} + +/* strcmp (), but caseless. */ +static int +stricmp (string1, string2) + char *string1, *string2; +{ + register char ch1, ch2; + + while (*string1 && *string2) + { + ch1 = *string1++; + ch2 = *string2++; + if (to_upper(ch1) != to_upper(ch2)) + return (1); + } + return (*string1 | *string2); +} +#endif + /* Determine if s2 occurs in s1. If so, return a pointer to the match in s1. The compare is case insensitive. */ static char * diff --git a/gnu/lib/libreadline/rltty.c b/gnu/lib/libreadline/rltty.c index 81f8ce5..8ca77da 100644 --- a/gnu/lib/libreadline/rltty.c +++ b/gnu/lib/libreadline/rltty.c @@ -21,7 +21,6 @@ have a copy of the license, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <sys/types.h> -#include <sys/ioctl.h> #include <signal.h> #include <errno.h> #include <stdio.h> @@ -30,6 +29,12 @@ # include <unistd.h> #endif /* HAVE_UNISTD_H */ +/* This is needed to include support for TIOCGWINSZ and window resizing. */ +#if defined (OSF1) || defined (BSD386) || defined (NetBSD) || \ + defined (FreeBSD) || defined (_386BSD) || defined (AIX) +# include <sys/ioctl.h> +#endif /* OSF1 || BSD386 */ + #include "rldefs.h" #include "readline.h" @@ -360,11 +365,13 @@ get_tty_settings (tty, tiop) int tty; TIOTYPE *tiop; { +#ifdef TIOCGWINSZ /* XXX this prevents to got editing mode from tcsh. Ache */ struct winsize w; if (ioctl (tty, TIOCGWINSZ, &w) == 0) (void) ioctl (tty, TIOCSWINSZ, &w); +#endif while (GETATTR (tty, tiop) < 0) { |