Make local changes more portable.

This commit is contained in:
ache 1994-05-14 01:18:07 +00:00
parent 6e4c5827ee
commit 1f29f4865e
4 changed files with 61 additions and 4 deletions

View File

@ -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 \

View File

@ -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

View File

@ -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 *

View File

@ -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)
{