%n libreadline %v 2.0 %c * %l * %b * %d * %f * %t bash-1.14.7.tgz %w Gnu %% if [ ! -d $BUILDDIR ];then mkdir $BUILDDIR;fi cd $BUILDDIR rm -rf bash-1.14.7 tar zixvf $SRCTARDIR/$TARFILE cd bash-1.14.7/lib/readline patch -u -p3 <<'ENDPATCH' diff -ru2N bash-1.14.7/lib/readline/Makefile bash-MCC/lib/readline/Makefile --- bash-1.14.7/lib/readline/Makefile Wed Jun 7 19:17:29 1995 +++ bash-MCC/lib/readline/Makefile Sat Aug 31 07:42:17 1996 @@ -19,5 +19,10 @@ # See the file STANDALONE for the -D defines that readline understands -DEFS = +DEFS = -DHAVE_STRCASECMP -DHAVE_UNISTD_H -DHAVE_STDLIB_H -DVOID_SIGHANDLER \ + -DHAVE_GETPW_DECLS -DHAVE_DIRENT_H -DHAVE_STRING_H -DHAVE_VARARGS_H \ + -DLinux -DSHELL -DHAVE_ALLOCA -DHAVE_ALLOCA_H +CFLAGS = -O6 -fomit-frame-pointer -fPIC +SHLIB = libreadline.so.2.0 +incdir = /usr/include # For libraries which include headers from other libraries. LOCAL_INCLUDES = -I. -I.. @@ -63,4 +68,8 @@ ########################################################################## +default: $(SHLIB) +$(SHLIB): $(OBJECTS) history.o + $(CC) -shared -o $(SHLIB) -Wl,-soname,$(SHLIB) $^ + all: libreadline.a libhistory.a @@ -84,5 +93,13 @@ # always returns TRUE unless there really was an error installing the # include files. -install: installdirs libreadline.a +install: $(SHLIB) + mkdir -p -m 555 $(incdir)/readline + install -m 444 readline.h keymaps.h chardefs.h history.h \ + tilde.h $(incdir)/readline + install -m 555 $(SHLIB) /lib + ln -sf ../../lib/$(SHLIB) /usr/lib/libreadline.so + ldconfig + +dummy: ${INSTALL_DATA} readline.h keymaps.h chardefs.h history.h \ $(incdir)/readline diff -ru2N bash-1.14.7/lib/readline/complete.c bash-MCC/lib/readline/complete.c --- bash-1.14.7/lib/readline/complete.c Tue Nov 7 15:51:19 1995 +++ bash-MCC/lib/readline/complete.c Sat Aug 31 07:42:17 1996 @@ -483,4 +483,5 @@ #if defined (SHELL) + if(libreadline_shell) /* Don't let word break characters in quoted substrings break words for the completer. */ @@ -498,5 +499,5 @@ scan = rl_line_buffer[rl_point]; #if defined (SHELL) - if ((found_quote == 0 || char_is_quoted (rl_line_buffer, rl_point) == 0) && + if ((!libreadline_shell || found_quote == 0 || char_is_quoted (rl_line_buffer, rl_point) == 0) && strchr (rl_completer_word_break_characters, scan)) #else @@ -539,5 +540,5 @@ /* Beware -- we're stripping the quotes here. Do this only if we know we are doing filename completion. */ - if (found_quote && our_func == (Function *)filename_completion_function) + if (libreadline_shell && found_quote && our_func == (Function *)filename_completion_function) { /* delete single and double quotes */ @@ -661,5 +662,5 @@ if (should_quote) #if defined (SHELL) - should_quote = should_quote && (!quote_char || quote_char == '"'); + should_quote = should_quote && (!quote_char || (libreadline_shell && quote_char == '"')); #else should_quote = should_quote && !quote_char; @@ -678,4 +679,5 @@ should_quote = rl_strpbrk (matches[0], rl_completer_word_break_characters) != 0; #if defined (SHELL) + if (libreadline_shell) should_quote = should_quote || rl_strpbrk (matches[0], "#$`?*[!") != 0; #endif @@ -686,5 +688,5 @@ if (do_replace != NO_MATCH) { -#if defined (SHELL) +if (libreadline_shell) { /* Quote the replacement, since we found an embedded word break character in a potential @@ -725,5 +727,5 @@ replacement[rlen - 1] = '\0'; free (rtext); -#else /* !SHELL */ +} else { /* Found an embedded word break character in a potential match, so we need to prepend a quote character if we @@ -733,5 +735,5 @@ *replacement = quote_char; strcpy (replacement + 1, matches[0]); -#endif /* SHELL */ +} } } @@ -1458,2 +1460,9 @@ } #endif /* STATIC_MALLOC */ + +#pragma weak single_quote = __junk +#pragma weak double_quote = __junk +#pragma weak set_lines_and_columns = __junk +#pragma weak char_is_quoted = __junk + +void __junk(){} diff -ru2N bash-1.14.7/lib/readline/history.c bash-MCC/lib/readline/history.c --- bash-1.14.7/lib/readline/history.c Mon Oct 9 19:21:57 1995 +++ bash-MCC/lib/readline/history.c Sat Aug 31 07:42:18 1996 @@ -52,4 +52,5 @@ #include "memalloc.h" +#include "rldefs.h" #include "history.h" @@ -968,5 +969,5 @@ if ((!substring_okay && (whitespace (c) || c == ':' || #if defined (SHELL) - member (c, ";&()|<>") || + (libreadline_shell && member (c, ";&()|<>")) || #endif /* SHELL */ string[i] == delimiting_quote)) || @@ -1308,4 +1309,6 @@ } + if (!libreadline_shell && (c == 'q' || c == 'x')) + c = 'z'; switch (c) { @@ -1496,5 +1499,5 @@ #if defined (SHELL) - if (want_quotes) + if (libreadline_shell && want_quotes) { char *x; @@ -1629,5 +1632,5 @@ in globbing [...] expressions, so let those pass without expansion. */ - else if (i > 0 && (string[i - 1] == '[') && + else if (libreadline_shell && i > 0 && (string[i - 1] == '[') && member (']', string + i + 1)) continue; @@ -1637,5 +1640,6 @@ } #if defined (SHELL) - else if (string[i] == '\'') + else if (libreadline_shell) + if (string[i] == '\'') { /* If this is bash, single quotes inhibit history expansion. */ @@ -1690,4 +1694,8 @@ #if defined (SHELL) case '\'': + if (!libreadline_shell) { + ADD_CHAR (string[i]); + break; + } { /* If this is bash, single quotes inhibit history expansion. */ diff -ru2N bash-1.14.7/lib/readline/readline.c bash-MCC/lib/readline/readline.c --- bash-1.14.7/lib/readline/readline.c Wed May 24 15:43:28 1995 +++ bash-MCC/lib/readline/readline.c Sat Aug 31 07:42:18 1996 @@ -105,4 +105,5 @@ int _rl_output_character_function (); +int libreadline_shell = 0; static char *readline_internal (); static void readline_initialize_everything (); @@ -1286,4 +1287,5 @@ #if defined (SHELL) + if(libreadline_shell) /* If we're being compiled as part of bash, set the environment variables $LINES and $COLUMNS to new values. */ diff -ru2N bash-1.14.7/lib/readline/rldefs.h bash-MCC/lib/readline/rldefs.h --- bash-1.14.7/lib/readline/rldefs.h Sat Feb 25 23:55:43 1995 +++ bash-MCC/lib/readline/rldefs.h Sat Aug 31 07:42:18 1996 @@ -210,3 +210,5 @@ #include "rlconf.h" +extern int libreadline_shell; + #endif /* !_RLDEFS_H */ diff -ru2N bash-1.14.7/lib/readline/rltty.c bash-MCC/lib/readline/rltty.c --- bash-1.14.7/lib/readline/rltty.c Thu Dec 15 21:07:07 1994 +++ bash-MCC/lib/readline/rltty.c Sat Aug 31 07:42:18 1996 @@ -205,9 +205,11 @@ TIOTYPE *tiop; { -#if !defined (SHELL) && defined (TIOCGWINSZ) +#if defined (TIOCGWINSZ) + if (!libreadline_shell) { struct winsize w; if (ioctl (tty, TIOCGWINSZ, &w) == 0) (void) ioctl (tty, TIOCSWINSZ, &w); + } #endif @@ -383,9 +385,11 @@ { int ioctl_ret; -#if !defined (SHELL) && defined (TIOCGWINSZ) +#if defined (TIOCGWINSZ) + if (!libreadline_shell) { struct winsize w; if (ioctl (tty, TIOCGWINSZ, &w) == 0) (void) ioctl (tty, TIOCSWINSZ, &w); + } #endif diff -ru2N bash-1.14.7/lib/readline/signals.c bash-MCC/lib/readline/signals.c --- bash-1.14.7/lib/readline/signals.c Thu Dec 14 15:05:13 1995 +++ bash-MCC/lib/readline/signals.c Sat Aug 31 07:42:19 1996 @@ -120,5 +120,5 @@ *old_int = (SigHandler *)NULL, *old_alrm = (SigHandler *)NULL; -#if !defined (SHELL) +#if defined (SHELL) static SigHandler *old_tstp = (SigHandler *)NULL, @@ -234,5 +234,5 @@ rl_set_sighandler (SIGALRM, SIG_IGN); -#if !defined (SHELL) +if (!libreadline_shell) { #if defined (SIGTSTP) @@ -252,5 +252,5 @@ #endif /* SIGTTOU */ -#endif /* !SHELL */ +} #if defined (SIGWINCH) @@ -266,5 +266,5 @@ rl_set_sighandler (SIGALRM, old_alrm); -#if !defined (SHELL) +if (!libreadline_shell) { #if defined (SIGTSTP) @@ -277,5 +277,5 @@ #endif /* SIGTTOU */ -#endif /* !SHELL */ +} #if defined (SIGWINCH) ENDPATCH make * make install %%