diff -aNrc2 bash-2.02.1/CHANGES bash-2.03/CHANGES *** bash-2.02.1/CHANGES Fri Jul 10 12:20:38 1998 --- bash-2.03/CHANGES Thu Feb 18 10:40:21 1999 *************** *** 1,2 **** --- 1,321 ---- + This document details the changes between this version, bash-2.03-release, + and the previous version, bash-2.03-beta2. + + 1. Changes to Bash + + a. A file descriptor leak in the `fc' builtin was fixed. + + b. A bug was fixed in the `read' builtin that caused occasional spurious + failures when using `read -e'. + + c. The version code needed to use the value of the cpp variable + CONF_MACHTYPE rather than MACHTYPE. + + d. A new test was added to exercise the command printing and copying code. + + e. A bug was fixed that caused `time' to be recognized as a reserved word + if it was the first pattern in a `case' statement pattern list. + + ------------------------------------------------------------------------------ + This document details the changes between this version, bash-2.03-beta2, + and the previous version, bash-2.03-beta1. + + 1. Changes to Bash + + a. Slight additions to support/shobj-conf, mostly for the benefit of AIX 4.2. + + b. config.{guess,sub} support added for the NEC SX4. + + c. Changed some of the cross-compiling sections of the configure macros in + aclocal.m4 so that configure won't abort. + + d. Slight changes to how the HTML versions of the bash and readline manuals + are generated. + + e. Fixed conditional command printing to avoid interpreting printf `%'-escapes + in arguments to [[. + + f. Don't include the bash malloc on all variants of the alpha processor. + + g. Changes to configure to make --enable-profiling work on Solaris 2.x. + + h. Fixed a bug that manifested itself when shell functions were called + between calls to `getopts'. + + i. Fixed pattern substitution so that a bare `#'as a pattern causes the + replacement string to be prefixed to the search string, and a bare + `%' causes the replacement string to be appended to the search string. + + j. Fixed a bug in the command execution code that caused child processes + to occasionally have the wrong value for $!. + + 2. Changes to Readline + + a. Added code to the history library to catch history substitutions using + `&' without a previous history substitution or search having been + performed. + + 3. New Features in Bash + + 4. New Features in Readline + + a. New bindable variable: `isearch-terminators'. + + b. New bindable function: `forward-backward-delete-char' (unbound by default). + + ------------------------------------------------------------------------------ + This document details the changes between this version, bash-2.03-beta1, + and the previous version, bash-2.03-alpha. + + 1. Changes to Bash + + a. A change was made to the help text for `{...}' to make it clear that a + semicolon is required before the closing brace. + + b. A fix was made to the `test' builtin so that syntax errors cause test + to return an exit status > 1. + + c. Globbing is no longer performed on assignment statements that appear as + arguments to `assignment builtins' such as `export'. + + d. System-specific configuration changes were made for: Rhapsody, + AIX 4.2/gcc, BSD/OS 4.0. + + e. New loadable builtins: ln, unlink. + + f. Some fixes were made to the globbing code to handle extended glob patterns + which immediately follow a `*'. + + g. A fix was made to the command printing code to ensure that redirections + following compound commands have a space separating them from the rest + of the command. + + h. The pathname canonicalization code was changed to produce fewer leading + `//' sequences, since those are interpreted as network file system + pathnames on some systems. + + i. A fix was made so that loops containing `eval' commands in commands passed + to `bash -c' would not exit prematurely. + + j. Some changes were made to the job reaping code when the shell is not + interactive, so the shell will retain exit statuses longer for examination + by `wait'. + + k. A fix was made so that `jobs | command' works again. + + l. The erroneous compound array assignment var=((...)) is now a syntax error. + + m. A change was made to the dynamic loading code in `enable' to support + Tenon's MachTen. + + n. A fix was made to the globbing code so that extended globbing patterns + will correctly match `.' in a bracket expression. + + 2. Changes to Readline + + a. A fix was made to the completion code in which a typo caused the wrong + value to be passed to the function that computed the longest common + prefix of the list of matches. + + b. The completion code now checks the value of rl_filename_completion_desired, + which is set by application-supplied completion functions to indicate + that filename completion is being performed, to decide whether or not to + call an application-supplied `ignore completions' function. + + 3. New Features in Bash + + a. A change was made to the startup file code so that any shell begun with + the `--login' option, even non-interactive shells, will source the login + shell startup files. + + 4. New Features in Readline + + a. A new variable, rl_erase_empty_line, which, if set by an application using + readline, will cause readline to erase, prompt and all, lines on which the + only thing typed was a newline. + + ------------------------------------------------------------------------------ + This document details the changes between this version, bash-2.03-alpha, + and the previous version, bash-2.02.1-release. + + 1. Changes to Bash + + a. System-specific configuration changes were made for: Irix 6.x, Unixware 7. + + b. The texi2dvi and texi2html scripts were updated to the latest versions + from the net. + + c. The configure tests that determine which native type is 32 bits were + changed to not require a compiled program. + + d. Fixed a bug in shell_execve that could cause memory to be freed twice + after a failed exec. + + e. The `printf' test uses `diff -a' if it's available to prevent confusion + due to the non-ascii output. + + f. Shared object configuration is now performed by a shell script, + support/shobj-conf, which generates values to be substituted into + makefiles by configure. + + g. Some changes were made to `ulimit' to avoid the use of RLIM_INVALID as a + return value. + + h. Changes were made to `ulimit' to work around HPUX 9.x's peculiar + handling of RLIMIT_FILESIZE. + + i. Some new loadable builtins were added: id, printenv, sync, whoami, push, + mkdir. `pushd', `popd', and `dirs' can now be built as regular or + loadable builtins from the same source file. + + j. Changes were made to `printf' to handle NUL bytes in the expanded format + string. + + k. The various `make clean' Makefile targets now descend into lib/sh. + + l. The `type' builtin was changed to use the internal `getopt' so that things + like `type -ap' work as expected. + + m. There is a new configuration option, --with-installed-readline, to link + bash with a locally-installed version of readline. Only readline version + 4.0 and later releases can support this. Shared and static libraries + are supported. The installed include files are used. + + n. There is a new autoconf macro used to find which basic type is 64 bits. + + o. Dynamic linking and loadable builtins should now work on SCO 3.2v5*, + AIX 4.2 with gcc, Unixware 7, and many other systems using gcc, where + the `-shared' options works correctly. + + p. A bug was fixed in the bash filename completion code that caused memory to + be freed twice if a directory name containing an unset variable was + completed and the -u option was set. + + q. The prompt expansion code now quotes the `$' in the `\$' expansion so it + is not processed by subsequent parameter expansion. + + r. Fixed a parsing bug that caused a single or double quote after a `$$' to + trigger ANSI C expansion or locale translation. + + s. Fixed a bug in the globbing code that caused quoted filenames containing + no globbing characters to sometimes be incorrectly expanded. + + t. Changes to the default prompt strings if prompt string decoding is not + compiled into the shell. + + u. Added `do', `then', `else', `{', and `(' to the list of keywords that may + precede the `time' reserved word. + + v. The shell may now be cross-built for BeOS as well as cygwin32. + + w. The conditional command execution code now treats `=' the same as `==' + for deciding when to perform pattern matching. + + x. The `-e' option no longer causes the shell to exit if a command exits + with a non-zero status while running the startup files. + + y. The `printf' builtin no longer dumps core if a modifier is supplied in + the format string without a conversion character (e.g. `%h'). + + z. Array assignments of the form a=(...) no longer show up in the history + list. + + aa. The parser was fixed to obey the POSIX.2 rules for finding the closing + `}' in a ${...} expression. + + bb. The history file is now opened with mode 0600 rather than 0666, so bash + no longer relies on the user's umask being set appropriately. + + cc. Setting LANG no longer causes LC_ALL to be assigned a value; bash now + relies on proper behavior from the C library. + + dd. Minor changes were made to allow quoted variable expansions using + ${...} to be completed correctly if there is no closing `"'. + + ee. Changes were made to builtins/Makefile.in so that configuring the shell + with `--enable-profiling' works right and builtins/mkbuiltins is + generated. + + 2. Changes to Readline + + a. The version number is now 4.0. + + b. There is no longer any #ifdef SHELL code in the source files. + + c. Some changes were made to the key binding code to fix memory leaks and + better support Win32 systems. + + d. Fixed a silly typo in the paren matching code -- it's microseconds, not + milliseconds. + + e. The readline library should be compilable by C++ compilers. + + f. The readline.h public header file now includes function prototypes for + all readline functions, and some changes were made to fix errors in the + source files uncovered by the use of prototypes. + + g. The maximum numeric argument is now clamped at 1000000. + + h. Fixes to rl_yank_last_arg to make it behave better. + + i. Fixed a bug in the display code that caused core dumps if the prompt + string length exceeded 1024 characters. + + j. The menu completion code was fixed to properly insert a single completion + if there is only one match. + + k. A bug was fixed that caused the display code to improperly display tabs + after newlines. + + 3. New Features in Bash + + a. New `shopt' option, `restricted_shell', indicating whether or not the + shell was started in restricted mode, for use in startup files. + + b. Filename generation is now performed on the words between ( and ) in + array assignments (which it probably should have done all along). + + c. OLDPWD is now auto-exported, as POSIX.2 seems to require. + + d. ENV and BASH_ENV are read-only variables in a restricted shell. + + 4. New Features in Readline + + a. Many changes to the signal handling: + o Readline now catches SIGQUIT and cleans up the tty before returning; + o A new variable, rl_catch_signals, is available to application writers + to indicate to readline whether or not it should install its own + signal handlers for SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, + SIGTTIN, and SIGTTOU; + o A new variable, rl_catch_sigwinch, is available to application + writers to indicate to readline whether or not it should install its + own signal handler for SIGWINCH, which will chain to the calling + applications's SIGWINCH handler, if one is installed; + o There is a new function, rl_free_line_state, for application signal + handlers to call to free up the state associated with the current + line after receiving a signal; + o There is a new function, rl_cleanup_after_signal, to clean up the + display and terminal state after receiving a signal; + o There is a new function, rl_reset_after_signal, to reinitialize the + terminal and display state after an application signal handler + returns and readline continues + + b. There is a new function, rl_resize_terminal, to reset readline's idea of + the screen size after a SIGWINCH. + + c. New public functions: rl_save_prompt and rl_restore_prompt. These were + previously private functions with a `_' prefix. + + d. New function hook: rl_pre_input_hook, called just before readline starts + reading input, after initialization. + + e. New function hook: rl_display_matches_hook, called when readline would + display the list of completion matches. The new function + rl_display_match_list is what readline uses internally, and is available + for use by application functions called via this hook. + + f. New bindable function, delete-char-or-list, like tcsh. + + ------------------------------------------------------------------------------ This document details the changes between this version, bash-2.02.1-release, and the previous version, bash-2.02-release. *************** *** 796,800 **** y. A fix was made to the parser so that `((cmd); cmd2)' is now parsed as ! a nested subshell rather than strictly as an (errnoeous) arithmetic command. --- 1115,1119 ---- y. A fix was made to the parser so that `((cmd); cmd2)' is now parsed as ! a nested subshell rather than strictly as an (erroneous) arithmetic command. diff -aNrc2 bash-2.02.1/COMPAT bash-2.03/COMPAT *** bash-2.02.1/COMPAT Mon Jul 28 13:36:52 1997 --- bash-2.03/COMPAT Tue Dec 29 10:01:25 1998 *************** *** 1,6 **** This document details the incompatibilites between this version of bash, ! bash-2.01, and the previous widely-available version, bash-1.14. These ! were discovered by alpha and beta testers, so they will likely be ! encountered by a significant number of users. 1. Bash now uses a new quoting syntax, $"...", to do locale-specific --- 1,6 ---- This document details the incompatibilites between this version of bash, ! bash-2.03, and the previous widely-available version, bash-1.14 (which ! is still the `standard' version for many Linux distributions). These ! were discovered by users of bash-2.x, so this list is not comprehensive. 1. Bash now uses a new quoting syntax, $"...", to do locale-specific *************** *** 64,70 **** 6. A number of people complained above having to use ESC to terminate an ! incremental search, and asked for an alternate mechanism. Bash-2.0 ! allows ^J to terminate the search without accepting the line. Use ! ^M to terminate the search and accept the line, as in bash-1.14. 7. Some variables have been removed: MAIL_WARNING, notify, history_control, --- 64,72 ---- 6. A number of people complained above having to use ESC to terminate an ! incremental search, and asked for an alternate mechanism. Bash-2.03 ! uses the value of the settable readline variable `isearch-terminators' ! to decide which characters should terminate an incremental search. If ! that variable has not been set, ESC and Control-J will terminate a ! search. 7. Some variables have been removed: MAIL_WARNING, notify, history_control, *************** *** 116,117 **** --- 118,126 ---- An interactive shell started in posix mode reads and executes commands from the file named by $ENV. + + 11. The <> redirection operator was changed to conform to the POSIX.2 spec. + In the absence of any file descriptor specification preceding the `<>', + file descriptor 0 is used. In bash-1.14, this was the behavior only + when in POSIX mode. The bash-1.14 behavior may be obtained with + + <>filename 1>&0 diff -aNrc2 bash-2.02.1/CWRU/POSIX.NOTES bash-2.03/CWRU/POSIX.NOTES *** bash-2.02.1/CWRU/POSIX.NOTES Tue Sep 23 13:39:25 1997 --- bash-2.03/CWRU/POSIX.NOTES Tue Oct 20 17:06:26 1998 *************** *** 25,30 **** setting of the `promptvars' option. ! 6. Interactive comments are enabled by default. (Note that Bash has ! them on by default anyway.) 7. The POSIX.2 startup files are executed (`$ENV') rather than the --- 25,30 ---- setting of the `promptvars' option. ! 6. Interactive comments are enabled by default. (Bash has them on by ! default anyway.) 7. The POSIX.2 startup files are executed (`$ENV') rather than the diff -aNrc2 bash-2.02.1/CWRU/README bash-2.03/CWRU/README *** bash-2.02.1/CWRU/README Tue May 2 13:31:46 1995 --- bash-2.03/CWRU/README Wed Jul 22 12:14:56 1998 *************** *** 15,17 **** --- 15,20 ---- compound commands + empty-for-wordlist - diff to parse.y to allow an empty wordlist after + the `in' keyword in a `for' statement + mh-folder-comp - diffs that reportedly add MH folder completion diff -aNrc2 bash-2.02.1/CWRU/changelog bash-2.03/CWRU/changelog *** bash-2.02.1/CWRU/changelog Wed Apr 15 10:26:18 1998 --- bash-2.03/CWRU/changelog Fri Feb 19 11:37:52 1999 *************** *** 3733,3734 **** --- 3733,5212 ---- [bash-2.02 frozen] + + 4/18 + ---- + [bash-2.02 released] + + 4/20 + ---- + bashline.c + - make sure that rl_defun is not called for + history-and-alias-expand-line unless both ALIAS and BANG_HISTORY + are defined + [in bash-2.02.1] + + 4/22 + ---- + make_cmd.c + - make sure that make_here_document allocates enough space for the + first line of the here document, by using the line length +2 + (instead of 1000, which is what the old code did, and breaks if + the first line of the here document is enough longer than 1000 + characters to cause other memory to be scribbled on) + [in bash-2.02.1] + + builtins/cd.def + - when in posix mode, a value of "" for CDPATH should be treated the + same as the current directory, not result in an error + [in bash-2.02.1] + + lib/malloc/malloc.c + - change the mh_align member of `union mhead' to be of type double + rather than a pointer, so that malloc will return (hopefully) + 8-byte aligned memory + [in bash-2.02.1] + + 4/23 + ---- + aclocal.m4 + - add a new macro to check whether or not off_t is 64 bits + + 4/24 + ---- + configure.in + - fixed a typo so the bash malloc is not compiled in on mips-sgi-irix6 + + lib/readline/display.c + - fix for readline redisplay if the prompt string is longer than the + screen width and includes invisible characters + [in bash-2.02.1] + + jobs.c + - make_child should not set the terminal's process group to + pipeline_pgrp if pipeline_pgrp == shell_pgrp (indicating that we + are forking a child for a command substitution) + [in bash-2.02.1] + + subst.c + - in execute_simple_command, in the child forked if there is a pipe + or the command is asynchronous, set subshell_environment to + SUBSHELL_ASYNC only if the command is asynchronous, SUBSHELL_FORK + if there is a pipe in or out + [in bash-2.02.1] + + 4/27 + ---- + support/texi2dvi + - upgraded to version 0.8 (from 0.5) + + support/texi2html + - upgraded to version 1.52 (from 1.51) + + support/config.sub + - config.sub now recognizes all the permutations of the system name + that config.guess produces for alphas + [in bash-2.02.1] + + aclocal.m4 + - changed BASH_TYPE_INT32_T, BASH_TYPE_U_INT32_T, and + BASH_TYPE_PTRDIFF_T to avoid compiling a program; instead use + the values determined by the AC_CHECK_SIZEOF tests to determine + the default values to supply to AC_CHECK_TYPE + + configure.in + - don't call AC_CHECK_TYPE({int32_t,u_int32_t,ptrdiff_t}) from + configure.in; use the updated BASH_TYPE macros instead + + builtins/exec.def + - if shell_execve fails, set ARGS to null because the realloc() call + by shell_execve may have caused it to be reallocated and freed -- + we don't want to free the memory twice + + lib/glob/fnmatch.c + - fixes from ache@nagual.pp.ru to make fnmatch work for eight-bit + characters when `isupper' and `islower' are used -- they were + restricted to ASCII characters before, probably to work around + some ancient, broken C libraries in which is{low,upp}er are valid + only for ASCII characters and return bogus values otherwise + [in bash-2.02.1] + + 4/29 + ---- + builtins/cd.def + - fixed a problem with the shell displaying the old working directory + instead of the new one after changing to a directory found via + $CDPATH when in physical mode (set -o physical) + [in bash-2.02.1] + + make_cmd.c + - make make_cond_command initialize the line number from the cond_node + that's passed as an argument (not that it's used right now) + + copy_cmd.c + - make sure that copy_cond_command copies the type of the cond command, + since execute_cond_command uses that to decide what kind of test + to perform + [in bash-2.02.1] + + builtins/printf.def + - make sure the for loop that processes the format string actually + consumes arguments; otherwise process it only once to avoid + infinite loops (e.g., `printf " " abc def ghi') + [in bash-2.02.1] + - if the format string is empty after preprocessing by ansicstr, + return immediately + [in bash-2.02.1] + + tests/run-printf + - use `diff -a' so the presence of a non-printing character in the + output doesn't confuse diff into thinking the files are binary + (test whether or not `diff' supports `-a' first) + + Makefile.in + - keep $(LOCAL_LIBS) from being specified twice + + 4/30 + ---- + support/shobj-conf + - a script to generate variables to do shared object configuration + for the loadable builtin stuff + + configure.in + - added a section for shared object configuration using an `eval' + of the output of shobj-conf and substituting the generated values + with AC_SUBST + + examples/loadables/Makefile.in + - the system-specific shared object configuration variables are now + substituted by configure + + 5/4 + --- + builtins/ulimit.def + - some changes for HPUX 9.x's peculiar handling of RLIMIT_FILESIZE + - changed the limit retrieval functions to return an error code + and the value in a reference argument to avoid use of RLIM_INVALID + + general.c + - new function, get_group_array(), which returns an array of + gids + + examples/loadables/{id,printenv,sync,uname,whoami,push}.c + - new loadable builtins + + variables.c + - moved code that initializes $PPID into a new function, set_ppid() + + variables.h + - extern declaration for set_ppid() + + 5/6 + --- + subst.c + - make sure that the `"' (double-quoted string) case of + expand_word_internal calls string_list_dollar_at if we've expanded + a double-quoted $@ so correct splitting on $IFS is done when + the expansion is complete. We can't simply call string_list + because that forces a space separator, and $IFS may not contain + a space + [in bash-2.02.1] + + 5/7 + --- + builtins/umask.def + - broke the code that parses a symbolic mode out of symbolic_umask + into a separate function that takes a symbolic mode and an initial + set of bits to modify + + examples/loadables/mkdir.c + - new loadable builtin + + 5/11 + ---- + builtins/printf.def + - use the format string length provided by ansicstr() to process the + format string, rather than testing for nullness, to handle NUL + bytes in the expanded format string + + builtins/pushd.def + - changes so it can be built as both a regular builtin and a loadable + builtin from the same source + + examples/loadables/Makefile.in + - changes to build pushd.c from ${topdir}/builtins/pushd.def and then + compile it with the correct flags to make it a loadable builtin, + even if PUSHD_AND_POPD is not defined in config.h + + 5/12 + ---- + lib/readline/complete.c + - use rl_completer_quote_characters instead of #ifdef SHELL/#endif + code in make_quoted_replacement. This means complete.c no longer + has any #ifdef SHELL code + + 5/13 + ---- + builtins/Makefile.in + - `make clean' should remove mkbuiltins.o + + Makefile.in + - all of the various `clean' targets need to descend into lib/sh + and run the appropriate target there + + builtins/type.def + - changed to use the builtin getopt. The old long options are + handled by prescanning the argument list looking for the long + options, processing them, and taking them out of the list before + passing it to internal_getopt() + + lib/readline/signals.c + - removed #ifdef SHELL code -- job control signals and SIGTERM are + always set in rl_set_signals, but are set to SIG_IGN if the old + handler was SIG_IGN (as bash sets it) + - new function rl_maybe_set_sighandler, which sets the signal + disposition back to SIG_IGN if the old handler was SIG_IGN + - removed #ifdef HANDLE_JOB_SIGNALS and #ifdef HANDLE_SIGTERM code + + lib/readline/rltty.c + - removed #ifdef SHELL code -- set_winsize is always called + to force the application to stop if it's not in the foreground + before getting the tty attributes + + 5/14 + ---- + lib/readline/signals.c + - readline now catches SIGQUIT and cleans up the tty before resending + it to its container application (unless the calling application has + set the disposition of SIGQUIT to be SIG_IGN) + - rl_handle_sigwinch is now called rl_sigwinch_handler + - rl_sigwinch_handler now calls rl_resize_terminal to fetch the + screen size after a SIGWINCH + - the sighandler_cxt struct for non-posix systems now includes + sa_flags and sa_mask variables, for future use + - new variable, rl_catch_signals, indicating that readline should + install its own signal handlers for SIGINT, SIGTERM, SIGQUIT, + SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU + - new variable, rl_catch_sigwinch, indicating that readline should + install its own SIGWINCH handler, which will chain to a calling + application's SIGWINCH handler + - new function, rl_free_line_state(), to free up variable state + associated with the current line after receiving a signal + - new function, rl_cleanup_after_signal(), to clean up the display + and terminal state after receiving a signal + - new function, rl_reset_after_signal(), to reinitialize the + terminal state after a signal handler returns and readline + continues + - rl_set_signals and rl_clear_signals now look at the values of + rl_catch_signals and rl_catch_sigwinch + + lib/readline/terminal.c + - new function rl_resize_terminal (), to reset readline's idea of + the screen size after a SIGWINCH + + lib/readline/readline.h + - extern declarations for rl_resize_terminal(), rl_free_line_state(), + rl_cleanup_after_signal(), rl_reset_after_signal() + - extern declarations for rl_catch_signals and rl_catch_sigwinch + + variables.c + - new functions, get_env_value(char *) and get_home_dir(void) to + satisfy references from the tilde and readline libraries when + they are compiled as part of bash + + lib/tilde/tilde.c + - rely on extern declarations of get_env_value and get_home_dir; + there is no more #ifdef SHELL code + + lib/readline/shell.c + - implementation of get_home_dir that uses getpwuid() to satisfy + references from tilde.c when not compiled as part of bash + - removed savestring() + - removed #ifdef SHELL/#endif pair -- all of these functions will be + resolved from bash when readline is linked into bash + + lib/readline/savestring.c + - new file, with function definition for savestring() for backwards + compatibility + + Makefile.in, _distribution + - bumped things up to bash-2.03-alpha + + 5/15 + ---- + lib/readline/rlconf.h + - removed #ifdef SHELL/#endif pair, so the callback stuff will be + compiled into libreadline, but never linked into bash (since it's + not referenced) + + configure.in + - added new `--with-installed-readline' option to allow readline to + be linked with an already-installed version -- this will probably + not work with versions of readline prior to 2.3 (libreadline.so.4) + [THIS IS STILL UNDOCUMENTED] + + Makefile.in + - changed necessary variables to allow the `--with-installed-readline' + option to work; shared and static libraries are supported + + 5/18 + ---- + lib/readline/display.c + - _rl_save_prompt is now rl_save_prompt; _rl_restore_prompt is now + rl_restore_prompt + + lib/readline/readline.h + - extern declarations for rl_save_prompt and rl_restore_prompt + + lib/readline/{search,isearch,readline,display}.c + - converted calls to _rl_{save,restore}_prompt () to use new public + versions + + lib/readline/doc/rltech.texinfo + - documented new public functions rl_{save,restore}_prompt + + 5/19 + ---- + lib/readline/readline.c + - new hook function variable, rl_pre_input_hook. If non-zero, it's + called from readline_internal_setup just before it returns and + readline starts reading input + + lib/readline/readline.h + - extern declaration for rl_pre_input_hook + + lib/readline/doc/rltech.texinfo + - documented new variable rl_pre_input_hook + + 5/20 + ---- + lib/readline/complete.c + - new hook function variable, rl_completion_display_matches_hook. + If non-null, this function is called when readline would normally + display the list of completion matches + + lib/readline/readline.h + - extern declaration for rl_completion_display_matches_hook + + lib/readline/doc/rltech.texinfo + - documented rl_completion_display_matches_hook + + lib/readline/readline.c + - if RL_LIBRARY_VERSION is not defined, define it to 4.0 to match + the version number of the shared libraries + + lib/readline/doc/{hist,rlman}.texinfo + - changed the version and edition to 4.0 to match the library version + + support/config.guess + - added case clause for matching UnixWare 7 from SCO (SVR5) -- further + work may be needed + [These fixes were in a usenet posting from hops@sco.com] + + support/config.sub + - added case clauses to recognize various aliases for SCO Open Server + and Open Desktop + [in bash-2.02.1] + - broke the code that canonicalizes unixware into unixware2 and + unixware7 clauses (multiple places) + [in bash-2.02.1] + - added clause to recognize `sysv5' for SVR5 + [These fixes were in a usenet posting from hops@sco.com] + [in bash-2.02.1] + + configure.in + - add `-b elf' to LOCAL_CFLAGS for sco3.2v5* to allow dynamic linking + (and loadable builtins) + - add AC_DEFINE(SVR5) on SVR5 (unixware 7) + + config.h.in + - add #undef SVR5, set by configure + + 5/21 + ---- + shell.c + - line-buffer stdout and stderr in shell_initialize only if + shell_initialized is 0 on all systems, not just SunOS 5 + [in bash-2.02.1] + + support/rlvers.sh + - script to print out the version number of any installed + readline library + + configure.in + - only allow --with-installed-readline if the version of the + installed readline library is 4.0 or greater + + 5/22 + ---- + lib/readline/complete.c + - broke the code that actually displays a list of completion + matches on the output stream into a separate public function, + rl_display_match_list, so it can be called from the hook + function rl_completion_display_matches_hook. + + lib/readline/readline.h + - new extern declaration for rl_display_match_list + + lib/readline/rltech.texinfo + - documented rl_display_match_list + + configure.in,Makefile.in + - --enable-static-link now creates a STATIC_LD variable in Makefile + rather than adding to LDFLAGS directly. LDFLAGS now includes + $(STATIC_LD) + + 6/2 + --- + builtins/cd.def + - OLDPWD is now auto-exported + - broke the code out of bindpwd() that updated the value of PWD in + the export environment in-place and made it general, so it can + be used for OLDPWD, too (this should be made *more* general, and + moved to variables.c) + + 6/3 + --- + variables.c + - moved builtins/cd.def:export_pwd_var to here, renamed it to + update_export_env_inplace + - converted put_command_name_into_env to just call + update_export_env_inplace + - made dummy variable for OLDPWD, marked as invisible and exported, + in initialize_shell_variables + + variables.h + - extern declaration for update_export_env_inplace + + builtins/cd.def + - changed calls to export_pwd_var to update_export_env_inplace + + lib/readline/bind.c + - added missing return in rl_unbind_function_in_map + - changed _rl_read_file to check whether or not `read' returns + < 0 rather than < file_size + - _rl_read_init_file needs to free `openname' after calling + _rl_read_file, since it's not used again + + lib/readline/callback.c + - bogus extern declaration for `readline_internal_startup', should + be readline_internal_setup + + lib/readline/histfile.c + - read_history_range now checks whether read(2) returns < 0 rather + than checking the return value against the file size + + lib/readline/parens.c + - whoops -- timer.tv_usec is *micro* seconds, not milliseconds + + lib/readline/readline.c + - initialize `eof' to 1 in readline_internal_charloop + + 6/5 + --- + configure.in + - if we're configuring with an installed version of readline, set and + have configure substitute RL_INCLUDE to `-I$(includedir)', so the + build process uses the installed readline include files as well as + the libraries + + Makefile.in, builtins/Makefile.in + - add @RL_INCLUDE@ in the appropriate places, substituted by configure + + lib/readline/{history,readline}.h + - add `extern "C"' wrapper if `__cplusplus' is defined + + lib/glob/fnmatch.h + - include stdc.h + - add prototypes to extern declaration for fnmatch() + + lib/readline/rlstdc.h + - link to ../posixheaders/stdc.h (in readline lib with different name + for benefit of standalone readline library installation) + + lib/readline/{history,keymaps}.h + - include rlstdc.h + - add prototypes to all of the extern function declarations + + lib/readline/history.h + - the `data' member of a HIST_ENTRY is now a histdata_t, which is + either a void * (ansi c) or a char * (k&r c) + + lib/readline/readline.c + - changed calls to replace_history_entry to pass a histdata_t as the + third parameter + + 6/8 + --- + copy_cmd.c + - make sure that copy_cond_command doesn't blindly try to copy + com->op, since that will be null for AND and OR nodes, at least + [in bash-2.02.1] + + lib/readline/vi_mode.c + - added missing second argument to rl_vi_[fbe][Ww]ord(), since + they're used as pseudo-bindable commands (they appear in the + default funmap) as well as utility functions + + lib/readline/readline.h + - include rlstdc.h + - added prototypes for functions from vi_mode.c, util.c, terminal.c, + search.c, util.c, undo.c, readline.c, parens.c, macro.c, kill.c, + keymaps.c, isearch.c, input.c, funmap.c, display.c, complete.c, + callback.c, + - added extern declarations for functions from rltty.c + + lib/readline/{readline,util}.c + - rl_refresh_line now takes the standard two arguments for bindable + commands; changed callers + + lib/readline/*.c + - small cleanups for incorrect arguments, etc. uncovered by use of + function prototypes + + bashline.c + - small cleanups for incorrect arguments, etc. uncovered by use of + function prototypes + + 6/11 + ---- + jobs.c + - cast result of strsignal() to (char *) for the benefit of broken + Cray UNICOS machines + [in bash-2.02.1] + + configure.in,aclocal.m4 + - new test, BASH_TYPE_BITS64_T, used to find out what basic type is + 64 bits long; defaults to `double' + - call AC_CHECK_SIZEOF(double) + + config.h.in + - #define for bits64_t, undef by default + + 6/24 + ---- + aclocal.m4 + - changed BASH_TYPE_BITS64_T so that it checks the size of a char * + first, before trying sizeof(double) + + lib/readline/doc/rluser.texinfo,doc/{bash.1,readline.3} + - changed default binding for tilde-expand to M-&, since bash + overrides M-~ to force username completion + + bashline.c + - fixed an off-by-one error in hostnames_matching that exhibited + itself when an exact multiple of 16 hostnames matched (fix + from ) + [in bash-2.02.1] + + 6/30 + ---- + lib/readline/readline.c + - the maximum numeric argument is now 1000000 + + bashline.c + - fixed a bug in bash_directory_completion_hook that caused memory + to be freed twice if a directory name containing an unset + variable was completed and `set -u' had been set + + configure.in + - on LynxOS, add a -DRECYCLES_PIDS to LOCAL_CFLAGS + + execute_cmd.c + - make sure that the changes to make the shell fork early when + run in the background do not cause commands such as `%1 &' + to fork + [in bash-2.02.1] + - if RECYCLES_PIDS is defined, execute_command_internal sets + last_made_pid to NO_PID after waiting for a foreground process, + if the return status is 0 (fix from plai@Lynx.COM (Paul Lai)) + + lib/readline/kill.c + - fixes from Andreas Schwab to rl_yank_last_arg that make it + behave better + + lib/readline/input.c + - fixes from Donald Beaudry to make the input buffering + and rl_stuff_char work right when the input buffer is nearly full + (probably not a problem with keyboard input, but maybe a problem + with programmers attempting to use rl_stuff_char to preload the + input buffer) + + 7/14 + ---- + parse.y + - fix to decode_prompt_string so that the \$ expansion quotes the `$' + so it won't be processed by subsequent parameter expansion + - change read_token_word so a $$ appearing in a token is recognized + and parsed immediately, so a single or double quote after the + second `$' doesn't cause ANSI-C expansion or locale translation + (bug report from haertel@ichips.intel.com) + + 7/16 + ---- + lib/readline/display.c + - fixed a bug that caused core dumps in xrealloc if the prompt was + longer than 1024 characters + + 7/21 + ---- + builtins/mkbuiltins.c + - if the number of characters read from the .def file is less than + the file size reported by `stat', and the read completed without + errors, reset the file size to avoid writing garbage at the end + of the generated .c file (needed on WIN32 systems, doesn't hurt + on Unix) + + 7/22 + ---- + CWRU/empty-for-wordlist + - patch from Brian Fox for parse.y to allow bash to accept an empty + `wordlist' after the `in' keyword in a for statement + + 7/23 + ---- + doc/bash.1 + - corrected the synopsis of the `for' and `select' statements to + indicate that the semicolon (or newline) after the optional + `in words' is required + + [bash-2.02.1 released] + + 7/28 + ---- + lib/readline/display.c + - make sure visible_length is initialized to 0 in rl_expand_prompt. + Fix from Gerhard Niklasch . + + lib/glob/glob.c + - make sure that quotes are removed from the filename being globbed + in glob_vector() before calling the GLOB_TESTNAME macro if there + are no globbing characters in the pattern + + doc/Makefile.in + - make sure that builtins.1 is looked for in $(srcdir) when running + `make install' (it's still commented out, though) + + 7/30 + ---- + config.h.bot + - if PROMPT_STRING_DECODE is not defined, define PPROMPT (the primary + prompt string) as "$ " + + variables.c + - if PROMPT_STRING_DECODE is not defined, and current_user.euid == 0, + PS1 defaults to "# ", otherwise it defaults to `primary_prompt' + + doc/bashbug.1 + - fixed email address prep.ai.mit.edu -> gnu.org + + 8/3 + --- + support/shobj-conf + - add `solaris2' as a possible OS name, treated the same as sunos5 + + 8/4 + --- + shell.c + - changed maybe_make_restricted() so that $ENV and $BASH_ENV are + read-only variables in a restricted shell + + doc/{bash.1,bashref.texi} + - added ENV and BASH_ENV to the list of readonly variables in + restricted mode + + parse.y + - added `do', `then', `else', `{', and `(' to the list of keywords + that may precede the `time' reserved word + + general.c + - added sanity checks to timeval_to_secs and clock_t_to_secs so + that if the fractional part is >= 1000, 1 is added to the + seconds and 1000 is subtracted from the fractional seconds + + 8/6 + --- + Makefile.in + - use $(CC_FOR_BUILD) to build mksignames + + configure.in + - changes to allow cross-building for BeOS as well as cygwin32 + + cross-build/{beos-sig.h,x86-beos.cache} + - new files for cross-compiling for BeOS + + 8/7 + --- + Makefile.in + - changed rule for version.h to use && instead of if-then-else-fi to + make sure the recipe fails if mkversion.sh fails + + configure.in + - beos does not use the GNU malloc + + lib/sh/itos.c + - broke itos into inttostr(i, buf, len) and itos(i), which calls + inttostr and returns a newly-allocated string with the result + + support/mksignames.c + - define `SIGKILLTHR' if system include files define it + + externs.h + - extern declaration for inttostr(int, char *, int) + + 8/13 + ---- + lib/sh/strtol.c + - include stdc.h before bashansi.h + + execute_cmd.c + - make sure that execute_cond_node treats `=' the same as `==' + + 8/25 + ---- + variables.c, print_cmd.c + - changed some calls to itos to use inttostr instead + + cross-build/x86-beos.cache, {execute_cmd,general,shell,trap}.c + - some changes for BeOS (from fnf@ninemoons.com) + + lib/posixheaders/memalloc.h + - changes to handle case where we're using both gcc and the C + version of alloca(), or if we have alloca.h and we're using + the C version of alloca() (from fnf@ninemoons.com) + + lib/sh/oslib.c + - if bcopy or bzero are #defines, #undef them before defining + replacement functions + + support/config.guess + - recognize AmigaOS (from fnf@ninemoons.com) + - recognize BeOS running on various machines + (from fnf@ninemoons.com) + + support/config.sub + - change basic_machine definition for amiga; added amigaos + (from fnf@ninemoons.com) + - changed definitions for MIPS machines running Linux (from + fnf@ninemoons.com) + - recognize `beos' as a valid operating system + (from fnf@ninemoons.com) + - changed OS for *-cbm to `amigaos' rather than `amigados' + (from fnf@ninemoons.com) + + examples/functions/autoload.v3 + - a new version, from Mark Kennedy + + lib/readline/readline.c + - new function, rl_delete_or_show_completions, like tcsh editing + function delete-char-or-list + + lib/readline/readline.h + - new extern declaration for rl_delete_or_show_completions + + lib/readline/funmap.c + - new bindable name `delete-char-or-list', like tcsh + + lib/readline/doc/rluser.texinfo, doc/{bash.1,readline.3} + - documented new delete-char-or-list command + + general.c + - fix full_pathname to keep it from generating things like + //foo when the current directory is / + + 8/27 + ---- + builtins/fc.def + - fixed the help text for the -e option + + 8/28 + ---- + support/shobj-conf + - added a clause for AIX 4.2 systems running gcc -- just the + standard gcc stuff for shared objects, but it has to come + before the other AIX 4.2 clause + + 8/31 + ---- + shell.c + - some changes so that `set -e' is turned off while executing + the startup files + + 9/3 + --- + flags.c + - new variable, `restricted_shell', non-zero if the shell was + started in restricted mode + + flags.h + - extern declaration for restricted_shell + + shell.c + - new function, shell_is_restricted, returns 1 if the shell is + supposed to be restricted based on the basename of $0 or the + -r option + - set restricted_shell to the value returned by shell_is_restricted + before executing the startup files + + externs.h + - extern declaration for shell_is_restricted + + builtins/shopt.def + - new shopt variable, restricted_shell, indicates whether the shell + was restricted at startup -- useful in startup files + + doc/{bash.1,bashref.texi} + - documented new restricted_shell shopt option + + 9/15 + ---- + lib/sh/rename.c + - new file, replacement for rename(2) if the OS doesn't provide it + + configure.in,config.h.in,Makefile.in,lib/sh/Makefile.in + - machinery for including rename.o in libsh.a + + nojobs.c + - make sure that set_tty_state returns a value + + builtins/mkbuiltins.c + - use a call to rename(2) instead of a link/unlink pair + + lib/glob/glob.c + - don't #define bcopy if bcopy is already defined + + lib/readline/histfile.c + - add a call to ftruncate for BeOS, which ignores the O_TRUNC flag + to open + + lib/readline/input.c + - make rl_getc loop if read returns -1/EINTR on BeOS + + configure.in + - set ARFLAGS and substitute it into the Makefiles + + {,builtins,lib/{glob,malloc,readline,sh,termcap,tilde}}/Makefile.in + - ARFLAGS is now substituted by configure + - use ARFLAGS in rules that create libraries using $(AR) + + builtins/printf.def + - fixed bug that caused a core dump when a modifier was supplied + in the format string without a conversion character (e.g. `%h') + + 9/17 + ---- + lib/glob/glob.c + - if filenames starting with a dot don't have to be matched + explicitly (e.g., after a `shopt -s dotglob'), don't match + `.' or `..' in any case + + eval.c + - make sure that array assignments don't show up in the history list + (fix from Andreas Schwab ) + + lib/readline/complete.c + - fix to rl_menu_complete so it inserts a single completion properly + when a word matches only one filename + + 9/24 + ---- + execute_cmd.c + - difftimeval should zero out the tv_usec field if the tv_sec field + is < 0 + - addtimeval should check for tv_usec being == 1000000 and add one + to tv_sec if it is + + 9/25 + ---- + subst.c + - fix to expand_word_internal to prevent non-whitespace IFS characters + from causing word splitting if they are not the results of an + expansion (not exactly right yet, but I think it's the result of a + problem with the ${...} end-brace-matching code in the parser) + + 9/28 + ---- + parse.y + - new flag for parse_matched_pair -- P_FIRSTCLOSE -- which makes it not + count and match additional construct open characters + - change calls to parse_matched_pair when matching braces in + ${...} constructs (both unquoted and within double quotes) to + specify the P_FIRSTCLOSE flag to match POSIX.2 requirements + + subst.c + - changed fix from 9/25, now that the parser problem is fixed + + 9/30 + ---- + variables.c + - change expansion of list of words between (...) in array assignments + to include pathname generation in assign_array_var_from_string + + doc/{bash.1,bashref.texi} + - clarified behavior of the shell at startup if running setuid, with + and without the -p option supplied + + 10/7 + ---- + bashhist.c + - change default open(2) mode to 0600 instead of 0666 for `privacy + concerns' + + 10/13 + ----- + lib/readline/display.c + - fixed a problem with displaying tabs after newlines, from + + - in update_line, if we are printing over existing material, + only call space_to_eol or _rl_clear_to_eol if lendiff is non-zero + - when moving the cursor in _rl_move_cursor_relative, only call + _rl_backspace if the current cursor position is strictly greater + than the desired cursor position + + 10/14 + ----- + locale.c + - LC_ALL is no longer set automatically when LANG is assigned a value + + config.h.{top,bot} + - renamed to config-{top,bot}.h, respectively + + config.h.in + - include config-top.h and config-bot.h + + Makefile.in + - things now depend on config-top.h and config-bot.h + + subst.c + - minor changes to extract_dollar_brace_string and char_is_quoted to + allow things like "${PIP[TAB] to perform correct variable completion + + 10/15 + ----- + builtins/Makefile.in + - add $(PROFILE_FLAGS) to the make recipe that creates `mkbuiltins', + so configuring with --enable-profiling works right + + 10/20 + ----- + doc/bashref.texi + - documented the new --with-installed-readline option + + [bash-2.03-alpha1 frozen] + + 10/21 + ----- + builtins/reserved.def + - fixed help text for { ... } to make it clear that a semicolon is + required before the closing brace + + 10/22 + ----- + trap.c + - in decode_signal, don't bother calling strcasecmp if + signal_names[sig] is null or empty + + 11/2 + ---- + configure.in + - make sure RL_LIBDIR and HIST_LIBDIR are assigned values even if + readline or history is configured out of the shell, so the -L + options have arguments in the link command + + test.c + - make test_syntax_error cause test to return a status > 1, to + conform to POSIX.2 4.62.8 + + doc/readline.3 + - make sure the SYNOPSIS section indicates that programmers should + include before + + 11/9 + ---- + Makefile.in + - install with explicit mode of 0755 + + 11/10 + ----- + builtins/test.def + - make sure that a missing `]' makes `[' exit with status 2, to + conform to POSIX.2 4.62.8 + + command.h + - new word flag: W_NOGLOB, meaning to not perform globbing + + execute_cmd.c + - fix_assignment_statements now turns on the W_NOGLOB flag for + arguments to `assignment builtins' that have W_ASSIGNMENT set + + subst.c + - expand_word_internal needs to preserve the W_NOGLOB flag from + the word being expanded to the word being returned + - glob_expand_word_list does not call shell_glob_filename for a + word with W_NOGLOB set + + builtins/shopt.def + - print_shopt is now void + + configure.in + - machines running Rhapsody don't use the bash malloc + - pass host_vendor to the Makefiles with AC_SUBST + + support/config.guess + - Rhapsody is really rhapsody, not nextstep + + support/config.sub + - add rhapsody to the list of supported configurations + + Makefile.in + - pass CONF_HOSTTYPE, CONF_OSTYPE, and CONF_MACHTYPE as -D options + in SYSTEM_FLAGS, to indicate that they came from the configuration + process + - set VENDOR variable from host_vendor configuration variable + - pass CONF_VENDOR as part of SYSTEM_FLAGS + + variables.c + - define HOSTTYPE, OSTYPE, and MACHTYPE as CONF_HOSTTYPE, CONF_OSTYPE, + and CONF_MACHTYPE, respectively + + 11/11 + ----- + doc/{bashref.texi,bash.1} + - updated description of `read' to clarify the -r option and its + effect on backslash escaping + + 11/13 + ----- + examples/loadables/{ln,unlink}.c + - new loadable builtins + + 11/23 + ----- + lib/glob/fnmatch.c + - some fixes to handle extended glob patterns immediately following + a `*' + + tests/extglob.tests + - updated with cases from bug report fixed today + + support/shobj-conf + - udpated stanza for aix 4.2 with gcc, based on information from + jik@cisco.com + + configure.in + - changes to add the correct linker options to allow dynamic linking + when using gcc on AIX 4.2, instead of insisting on the AIX C + compiler + + examples/misc/aliasconv.{bash,sh} + - changes to handle aliases with embedded single quotes + + 11/25 + ----- + lib/readline/complete.c + - postprocess_matches should call compute_lcd_of_matches with an + argument of `t' instead of `text' + - postprocess_matches should never call ding(); leave that for the + callers + - postprocess_matches no longer needs `text' as the first argument + - rl_complete_internal needs to call ding() if postprocess_matches + returns 0, since postprocess_matches no longer does it + - rl_complete_internal can now free `text' immediately after calling + gen_completion_matches, since it's no longer used + + 11/30 + ----- + print_cmd.c + - make sure redirections following compound commands have a space + separating them from the command + + 12/1 + ---- + general.c + - changed canonicalize_pathname so that if the result path begins + with `//', it will be changed to `/' if and only if the original + path did not begin with `//' (there has to be a non-slash after + the leading `///' in the original path) + + 12/2 + ---- + builtins/evalstring.c + - augment the test for turning on CMD_NO_FORK to make sure that + parse_and_execute_level == 1. That takes care of things like + + bash -c 'for f in 1 2 3; do eval "/bin/echo \"$f\"" ; done' + + only printing one line of output + + 12/8 + ---- + config-top.h + - add commented-out #define for NON_INTERACTIVE_LOGIN_SHELLS so + that users may, if they choose, make things like + + #! /bin/bash --login + + work in shell scripts + + 12/10 + ----- + jobs.c + - changes to the way jobs are reaped when the shell is not + interactive: + + o notify_of_job_status no longer marks dead jobs as + notified if they did not exit due to a signal; + o changed mark_background_jobs_as_notified to take an + argument `force': if zero, we only mark enough + dead jobs as notified to keep CHILD_MAX jobs in the + jobs list, as POSIX.2 specifies. If non-zero, mark + all dead jobs as notified; + o wait_for_background_pids marks all dead jobs as + notified when it has finished waiting for everything, + since the only thing that calls it is the `wait' builtin; + o wait_for_single_pid marks a job as notified after it + has completed, since the only things that call it are + wait_for_background_pids and the `wait' builtin + o wait_for_job marks the job as notified after the last + pid completes + + execute_cmd.c + - change execute_subshell_builtin_or_function to check + subshell_environment and pipe_out to decide whether or not to fork + if builtin == jobs_builtin, since the early-forking code added in + bash-2.02 means that the piping has probably already been done + + 12/15 + ----- + parse.y + - changes to make avar=((...)) a syntax error instead of ignoring + the nested parens and treating it as an array assignment + + shell.c + - changed run_startup_files so that any shell, whether or not it is + interactive, will run the login shell startup files when given the + --login option. This happens only when not in posix mode. + + builtins/enable.def + - changes to handle Tenon's MachTen, whose dlclose() does not return + a value + + lib/glob/fnmatch.c + - changed gmatch so that when it calls extmatch, it removes FNM_PERIOD + from the flags if it's not matching at the start of the string. + This fixes the problem of `@' and `+' extended-glob subpatterns + containing bracket expressions treating `.' specially when matching + a portion of the string starting with `.' + + config-top.h + - removed define for NON_INTERACTIVE_LOGIN_SHELLS, since it's no longer + necessary + + 12/17 + ----- + lib/readline/complete.c + - change rl_complete_internal and rl_menu_complete to check + rl_filename_completion_desired to decide whether or not we're + completing filenames instead of checking whether the attempted + completion function is filename_completion_function. + filename_completion_function sets rl_filename_completion_desired, + so this shouldn't break anything -- just allow postprocessing of + matches for user-supplied filename completion functions that don't + call filename_completion_function + + lib/readline/display.c + - new function, _rl_erase_entire_line, which erases the entire line, + no matter where the cursor is, and puts the cursor at the beginning + of the (newly-empty) line + + lib/readline/readline.c + - new application-level variable, rl_erase_empty_line, which, if + non-zero, tells readline to erase the contents of the current line, + prompt and all, if the only character typed to an otherwise-blank + line is bound to rl_newline. Requested by the Cygnus GDB folks. + - change to rl_newline to suppress the call to _rl_update_final if + rl_erase_empty_line is non-zero, and rl_point == rl_end == 0, since + _rl_update_final calls crlf() + - change to readline_internal_charloop to call _rl_erase_entire_line + if newline was the only thing typed on an otherwise-empty line + + lib/readline/readline.h + - extern declaration for rl_erase_empty_line + + lib/readline/doc/rltech.texinfo + - documented new rl_erase_empty_line variable + + 12/18 + ----- + Makefile.in + - changed RELSTATUS to `beta1' + + [bash-2.03-beta1 frozen] + + 12/21 + ----- + doc/{bash.1,bashref.texi} + - added description of `test -h'; equivalent to `test -L' + + 12/22 + ----- + support/shobj-conf + - SHOBJ_LDFLAGS should be those options to ld which are common + between building dynamically loadable shared objects and shared + libraries + - added two new variables: SHOBJ_XLDFLAGS, which are ld options + specific to building dynamically loaded shared objects, and + SHLIB_LIBS, which are other libraries against which shared libraries + should be linked. These are for the benefit of AIX 4.2; other + stanzas do not need to be changed. + + configure.in + - add call to AC_SUBST for SHOBJ_XLDFLAGS + + examples/loadables/Makefile.in + - SHOBJ_XLDFLAGS is now substituted by configure + - $(SHOBJ_LDFLAGS) -> $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) in all + recipes that build loadable builtins + + 12/29 + ----- + support/config.{guess,sub} + - changes for NEC SX4 machines running SUPER-UX (?). Info from + Nicholas Clark + + lib/readline/bind.c + - new bindable variable, `isearch-terminators', which is the list of + characters that will terminate an incremental search without + subsequently executing the character as a command + + lib/readline/isearch.c + - changes to incorporate the new isearch-terminators bindable variable; + uses new private readline variable _rl_isearch_terminators + (suggested by Brian Fox) + + doc/{bash.1,readline.3}, lib/readline/doc/rluser.texinfo + - documented new `isearch-terminators' settable variable + + lib/readline/complete.c + - new convenience function, free_match_list, called from + rl_complete_internal + + 12/30 + ----- + aclocal.m4 + - changed the calls to AC_MSG_ERROR in the cross-compiling sections + to AC_MSG_WARN, since AC_MSG_ERROR can cause configure to abort + + examples/functions/which + - new function, emulation of `which' as it appears in FreeBSD + + 12/31 + ----- + lib/readline/readline.c + - new bindable function: rl_rubout_or_delete. Does rl_rubout if + rl_point is at the end of the line, or rl_delete if not. This + is intended to mimic the Motif/Netscape/GNOME behavior of the + DEL character, and can be bound to delete to get that behavior + + lib/readline/readline.h + - new extern declaration for rl_rubout_or_delete + + lib/readline/funmap.c + - bound the name `forward-backward-delete-char' to + rl_rubout_or_delete (currently not bound to any keys) + + lib/readline/doc/manvers.texinfo + - new file with readline manual version information, to mantain + consistent numbering between readline and history manuals + + lib/readline/doc/{rlman,hist}.texinfo + - @include manvers.texinfo for version information + - moved the @dircategory and and @direntry directives inside + the @ifinfo block + - changed copyrights to 1988-1999 + + doc/Makefile.in, lib/readline/doc/Makefile.in + - texi2html is now called with -menu (to handle the texinfo menus) + and -monolithic (to include the table of contents in the generated + HTML file instead of putting it in a separate file + - changed recipes to remove references to TOC html files + + lib/glob/fnmatch.c + - include or as appropriate for strchr() + declaration + + 1/4/99 + ------ + print_cmd.c + - don't print bare words when printing conditional expressions in + print_cond_node, use cprintf("%s", cond->op->word) + + subst.c + - in separate_out_assignments, if VARLIST is non-null on function + entry, free it up to clean up after a previous error longjmp + + 1/5 + --- + configure.in + - make sure the case clause that disables the bash malloc on alpha + machines catches things like `alphaev56' as well as `alpha' + + 1/12 + ---- + lib/readline/histlib.h + - new error message code: NO_PREV_SUBST + + lib/readline/histexpand.c + - handle NO_PREV_SUBST with appropriate error message in hist_error + - in history_expand_internal, if the `s' or `&' case results in a + null or empty LHS, return NO_PREV_SUBST + + error.c + - new interface: command_error(func, code, e, flags); intended to + collect command-related errors in one place + - new interface: command_errstr(code); returns a string describing + command error CODE + + error.h + - extern declarations for command_error and command_errstr + + command.h + - possible values for CODE in calls to command_error and command_errstr + + {shell,print_cmd,make_cmd,execute_cmd,dispose_cmd,eval}.c ,builtins/evalstring.c + - changed some calls to programming_error to use command_error + + 1/13 + ---- + configure.in + - if --enable-profiling is specified on a solaris2 machine, don't + turn on enable-static-link, since it's very hard to build a + static binary on solaris2 and gprof does not (apparently) require it + + builtins/getopts.def + - add calls to sh_getopt_restore_state so the state is restored each + time getopts is called. This protects us against the behavior of + some mallocs, which causes `nextchar' to be set to garbage in + getopt.c when a function is called between calls to getopts + + 1/14 + ---- + lib/readline/complete.c + - if postprocess_matches returns 0 in rl_complete_internal, reset + completion_changed_buffer to 0 before returning, since nothing + has been changed + + 1/20 + ---- + subst.c + - fixed pat_subst so that null patterns with a `#' specifier prefix + the string to be substituted on with the replacement, and null + patterns with a `%' specifier append the replacement to the string + to be substituted on + + doc/{bash.1,bashref.texi} + - corrected a small error in the description of parameter pattern + substitution + + support/mksignames.c + - SIGINFO means something else on sequent systems + + 1/26 + ---- + execute_cmd.c + - fix to execute_simple_command to keep a child process from getting + a bad value of last_asynchronous_pid when the shell forks early + + 2/1 + --- + Makefile.in + - changed RELSTATUS to `beta2' + + 2/2 + --- + [bash-2.03-beta2 released] + + 2/3 + --- + tests/{cprint.{tests,right},run-cprint} + - new test to exercise the command printing and copying code -- + hopefully this will avoid things like the `conditional commands + in functions make the shell abort' problem + + 2/4 + --- + version.c + - if MACHTYPE is not defined, use CONF_MACHTYPE if it's defined + + 2/5 + --- + builtins/read.def + - if READLINE is defined, we need an extra pair of braces around + the `while' loop that reads from fd 0 if the -e option is + supplied, otherwise the code erroneously tests the value of + `retval', which is not set when using readline + + 2/15 + ---- + builtins/fc.def + - make sure that fc closes `stream' before calling fc_execute_file + + 2/17 + ---- + builtins/fc.def + - don't bother opening and closing the file of commands before + calling fc_execute_file, since parse_and_execute will write the + commands to the history file for us + + Makefile.in + - changed release status to `release' + + 2/18 + ---- + parse.y + - change to special_case_tokens so that `time' is not recognized + as a reserved word while the parser is parsing a case statement + pattern list (if `time' is the first pattern, the last read + token will be newline, which time_command_acceptable says is OK + to start a pipeline) + + pathexp.c + - some changes to the POSIX_GLOB_LIBRARY code (often unused) + + shell.c + - a couple of changes for Interix (nee OPENNT) + - added code that handles systems without a third argument to main(); + initializing `env' from `environ', conditionalized on a cpp define + NO_MAIN_ENV_ARG + + configure.in, config.h.in + - check for the presence of sbrk(2); define HAVE_SBRK if found + + xmalloc.c + - don't do the space allocated computation when malloc or realloc + fails if HAVE_SBRK is not defined + + configure.in + - new configure variable, MAKE_SHELL, defaults to /bin/sh + + Makefile.in,{builtins,doc,support,lib/{glob,malloc,readline,sh,termcap,tilde},examples/loadables}/Makefile.in + - set SHELL from @MAKE_SHELL@ + + lib/posixheaders/posixjmp.h + - Don't override defines for setjmp and longjmp in on + Internix (nee OPENNT) + + lib/readline/complete.c + - Interix (OPENNT) doesn't do username completion + + configure.in + - on Interix/OPENNT ($host_os == interix* or opennt*), add + -DNO_MAIN_ENV_ARG to LOCAL_CFLAGS + - on Interix/OPENNT, set MAKE_SHELL to $OPENNT_ROOT/bin/sh rather + than a straight /bin/sh + + cross-build/opennt.cache + - a `configure' cache file for Interix/OPENNT; not necessarily + for cross-compiling, but this is where the other system cache + files are + + [bash-2.03 released] diff -aNrc2 bash-2.02.1/CWRU/empty-for-wordlist bash-2.03/CWRU/empty-for-wordlist *** bash-2.02.1/CWRU/empty-for-wordlist Wed Dec 31 19:00:00 1969 --- bash-2.03/CWRU/empty-for-wordlist Wed Jul 22 12:16:28 1998 *************** *** 0 **** --- 1,25 ---- + This patch is from Brian Fox, in reply to an email message from + "Marcin 'Qrczak' Kowalczyk" , who wrote: + + I think that bash should accept such a syntax: + + for var in ; do command; done + + Of course it should do nothing. It would simplify some scripts. + + Here is a patch for those who wish it: + + *** parse.y.~1~ Wed Mar 4 09:39:46 1998 + --- parse.y Mon Jul 13 14:40:23 1998 + *************** + *** 495,500 **** + --- 495,504 ---- + { $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9); } + | FOR WORD newline_list IN word_list list_terminator newline_list '{' compound_list '}' + { $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9); } + + | FOR WORD newline_list IN list_terminator newline_list DO compound_list DONE + + { $$ = make_for_command ($2, (WORD_LIST *)NULL, $8); } + + | FOR WORD newline_list IN list_terminator newline_list '{' compound_list '}' + + { $$ = make_for_command ($2, (WORD_LIST *)NULL, $8); } + ; + diff -aNrc2 bash-2.02.1/CWRU/misc/errlist.c bash-2.03/CWRU/misc/errlist.c *** bash-2.02.1/CWRU/misc/errlist.c Wed Dec 31 19:00:00 1969 --- bash-2.03/CWRU/misc/errlist.c Mon Aug 24 12:32:48 1998 *************** *** 0 **** --- 1,39 ---- + /* + * If necessary, link with lib/sh/libsh.a + */ + + #include + #include + + extern char *strerror(); + + extern int sys_nerr; + + int + main(c, v) + int c; + char **v; + { + int i, n; + + if (c == 1) { + for (i = 1; i < sys_nerr; i++) + printf("%d --> %s\n", i, strerror(i)); + } else { + for (i = 1; i < c; i++) { + n = atoi(v[i]); + printf("%d --> %s\n", n, strerror(n)); + } + } + exit (0); + } + + programming_error(a, b) + char *a; + int b; + { + } + + fatal_error() + { + } diff -aNrc2 bash-2.02.1/CWRU/misc/hpux10-dlfcn.h bash-2.03/CWRU/misc/hpux10-dlfcn.h *** bash-2.02.1/CWRU/misc/hpux10-dlfcn.h Wed Dec 31 19:00:00 1969 --- bash-2.03/CWRU/misc/hpux10-dlfcn.h Tue Jan 5 13:59:20 1999 *************** *** 0 **** --- 1,45 ---- + /* + * HPUX 10.x stubs to implement dl* in terms of shl* + * + * Not needed for later versions; HPUX 11.x has dlopen() and friends. + * + * configure also needs to be faked out. You can create a dummy libdl.a + * with stub entries for dlopen, dlclose, dlsym, and dlerror: + * + * int dlopen() { return(0);} + * int dlclose() { return(0);} + * int dlsym() { return(0);} + * int dlerror() { return(0);} + * + * This has not been tested; I just read the manual page and coded this up. + * + * According to the ld manual page, you need to link bash with -dld and add + * the -E flag to LOCAL_LDFLAGS. + */ + + #if !defined (__HPUX10_DLFCN_H__) + + #define __HPUX10_DLFCN_H__ + + #include + #include + + #ifndef errno + extern int errno; + #endif + + #define RTLD_LAZY BIND_DEFERRED + #define RTLD_NOW BIND_IMMEDIATE + #define RTLD_GLOBAL DYNAMIC_PATH + + char *bash_global_sym_addr; + + #define dlopen(file,mode) (void *)shl_load((file), (mode), 0L) + + #define dlclose(handle) shl_unload((shl_t)(handle)) + + #define dlsym(handle,name) (bash_global_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&bash_global_sym_addr), (void *)bash_global_sym_addr) + + #define dlerror() strerror(errno) + + #endif /* __HPUX10_DLFCN_H__ */ diff -aNrc2 bash-2.02.1/INSTALL bash-2.03/INSTALL *** bash-2.02.1/INSTALL Thu Jul 23 10:37:54 1998 --- bash-2.03/INSTALL Tue Oct 20 17:05:53 1998 *************** *** 17,24 **** remove or edit it. ! If you need to do unusual things to compile the package, please try to ! figure out how `configure' could check whether or not to do them, and ! mail diffs or instructions to `bash-maintainers@prep.ai.mit.edu' so ! they can be considered for the next release. The file `configure.in' is used to create `configure' by a program --- 17,24 ---- remove or edit it. ! If you need to do unusual things to compile Bash, please try to figure ! out how `configure' could check whether or not to do them, and mail ! diffs or instructions to so they can be ! considered for the next release. The file `configure.in' is used to create `configure' by a program *************** *** 30,35 **** will need to create two files: `_distribution' and `_patchlevel'. `_distribution' should contain the major and minor version numbers of ! the Bash distribution, for example `2.02'. `_patchlevel' should ! contain the patch level of the Bash distribution, `1' for example. The script `support/mkconffiles' has been provided to automate the creation of these files. --- 30,35 ---- will need to create two files: `_distribution' and `_patchlevel'. `_distribution' should contain the major and minor version numbers of ! the Bash distribution, for example `2.01'. `_patchlevel' should ! contain the patch level of the Bash distribution, `0' for example. The script `support/mkconffiles' has been provided to automate the creation of these files. *************** *** 116,121 **** You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you ! give `configure' the option `--exec-prefix=PATH', the package will use ! `PATH' as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. --- 116,121 ---- You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you ! give `configure' the option `--exec-prefix=PATH', `make install' will ! use `PATH' as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. *************** *** 124,130 **** There may be some features `configure' can not figure out ! automatically, but needs to determine by the type of host the package ! will run on. Usually `configure' can figure that out, but if it prints ! a message saying it can not guess the host type, give it the `--host=TYPE' option. `TYPE' can either be a short name for the system type, such as `sun4', or a canonical name with three fields: --- 124,130 ---- There may be some features `configure' can not figure out ! automatically, but needs to determine by the type of host Bash will run ! on. Usually `configure' can figure that out, but if it prints a ! message saying it can not guess the host type, give it the `--host=TYPE' option. `TYPE' can either be a short name for the system type, such as `sun4', or a canonical name with three fields: *************** *** 178,187 **** The Bash `configure' has a number of `--enable-FEATURE' options, where ! FEATURE indicates an optional part of the package. There are also ! several `--with-PACKAGE' options, where PACKAGE is something like ! `gnu-malloc' or `purify' (for the Purify memory allocation checker). To ! turn off the default use of a package, use `--without-PACKAGE'. To ! configure Bash without a feature that is enabled by default, use ! `--disable-FEATURE'. Here is a complete list of the `--enable-' and `--with-' options that --- 178,186 ---- The Bash `configure' has a number of `--enable-FEATURE' options, where ! FEATURE indicates an optional part of Bash. There are also several ! `--with-PACKAGE' options, where PACKAGE is something like `gnu-malloc' ! or `purify'. To turn off the default use of a package, use ! `--without-PACKAGE'. To configure Bash without a feature that is ! enabled by default, use `--disable-FEATURE'. Here is a complete list of the `--enable-' and `--with-' options that *************** *** 213,216 **** --- 212,220 ---- option automatically for a number of systems. + `--with-installed-readline' + Define this to make bash link with a locally-installed version of + Readline rather than the version in lib/readline. This works only + with readline 4.0 and later versions. + `--with-purify' Define this to use the Purify memory allocation checker from Pure *************** *** 242,255 **** `--enable-alias' Allow alias expansion and include the `alias' and `unalias' ! builtins. `--enable-array-variables' ! Include support for one-dimensional array shell variables. `--enable-bang-history' ! Include support for `csh'-like history substitution. `--enable-brace-expansion' Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ). `--enable-command-timing' --- 246,262 ---- `--enable-alias' Allow alias expansion and include the `alias' and `unalias' ! builtins (*note Aliases::.). `--enable-array-variables' ! Include support for one-dimensional array shell variables (*note ! Arrays::.). `--enable-bang-history' ! Include support for `csh'-like history substitution (*note History ! Interaction::.). `--enable-brace-expansion' Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ). + See *Note Brace Expansion::, for a complete description. `--enable-command-timing' *************** *** 260,268 **** `--enable-cond-command' ! Include support for the `[[' conditional command. `--enable-directory-stack' Include support for a `csh'-like directory stack and the `pushd', ! `popd', and `dirs' builtins. `--enable-disabled-builtins' --- 267,276 ---- `--enable-cond-command' ! Include support for the `[[' conditional command (*note ! Conditional Constructs::.). `--enable-directory-stack' Include support for a `csh'-like directory stack and the `pushd', ! `popd', and `dirs' builtins (*note The Directory Stack::.). `--enable-disabled-builtins' *************** *** 273,277 **** `--enable-dparen-arithmetic' ! Include support for the `ksh' `((...))' command. `--enable-extended-glob' --- 281,286 ---- `--enable-dparen-arithmetic' ! Include support for the `((...))' command (*note Conditional ! Constructs::.). `--enable-extended-glob' *************** *** 288,305 **** `--enable-job-control' ! This enables job control features, if the OS supports them. `--enable-process-substitution' This enables process substitution (*note Process Substitution::.) ! if the OS provides the necessary support. `--enable-prompt-string-decoding' Turn on the interpretation of a number of backslash-escaped characters in the `$PS1', `$PS2', `$PS3', and `$PS4' prompt ! strings. `--enable-readline' Include support for command-line editing and history with the Bash ! version of the Readline library. `--enable-restricted' --- 297,316 ---- `--enable-job-control' ! This enables the job control features (*note Job Control::.), if ! the operating system supports them. `--enable-process-substitution' This enables process substitution (*note Process Substitution::.) ! if the operating system provides the necessary support. `--enable-prompt-string-decoding' Turn on the interpretation of a number of backslash-escaped characters in the `$PS1', `$PS2', `$PS3', and `$PS4' prompt ! strings. See *Note Printing a Prompt::, for a complete list of ! prompt string escape sequences. `--enable-readline' Include support for command-line editing and history with the Bash ! version of the Readline library (*note Command Line Editing::.). `--enable-restricted' *************** *** 309,314 **** `--enable-select' ! Include the `ksh' `select' builtin, which allows the generation of ! simple menus. `--enable-usg-echo-default' --- 320,325 ---- `--enable-select' ! Include the `select' builtin, which allows the generation of simple ! menus (*note Conditional Constructs::.). `--enable-usg-echo-default' diff -aNrc2 bash-2.02.1/MANIFEST bash-2.03/MANIFEST *** bash-2.02.1/MANIFEST Tue Mar 3 15:03:27 1998 --- bash-2.03/MANIFEST Thu Feb 18 12:46:45 1999 *************** *** 44,52 **** README f AUTHORS f configure.in f configure f Makefile.in f ! config.h.top f ! config.h.bot f config.h.in f aclocal.m4 f --- 44,53 ---- README f AUTHORS f + Y2K f configure.in f configure f Makefile.in f ! config-top.h f ! config-bot.h f config.h.in f aclocal.m4 f *************** *** 196,199 **** --- 197,203 ---- cross-build/cygwin32.cache f cross-build/win32sig.h f + cross-build/x86-beos.cache f + cross-build/beos-sig.h f + cross-build/opennt.cache f lib/glob/ChangeLog f lib/glob/Makefile.in f *************** *** 257,260 **** --- 261,265 ---- lib/readline/nls.c f lib/readline/shell.c f + lib/readline/savestring.c f lib/readline/tilde.c f lib/readline/tilde.h f *************** *** 273,277 **** --- 278,284 ---- lib/readline/posixstat.h f lib/readline/ansi_stdlib.h f + lib/readline/rlstdc.h f lib/readline/doc/Makefile f + lib/readline/doc/manvers.texinfo f lib/readline/doc/rlman.texinfo f lib/readline/doc/rltech.texinfo f *************** *** 293,296 **** --- 300,304 ---- lib/sh/itos.c f lib/sh/oslib.c f + lib/sh/rename.c f lib/sh/setlinebuf.c f lib/sh/strcasecmp.c f *************** *** 320,323 **** --- 328,332 ---- lib/termcap/grot/COPYING f lib/termcap/grot/README f + lib/tilde/README f lib/tilde/ChangeLog f lib/tilde/Makefile.in f *************** *** 326,329 **** --- 335,339 ---- lib/tilde/tilde.c f lib/tilde/tilde.h f + lib/tilde/shell.c f CWRU/misc/open-files.c f CWRU/misc/sigs.c f *************** *** 331,334 **** --- 341,346 ---- CWRU/misc/sigstat.c f CWRU/misc/bison f + CWRU/misc/errlist.c f + CWRU/misc/hpux10-dlfcn.h f CWRU/PLATFORMS f CWRU/README f *************** *** 336,339 **** --- 348,352 ---- CWRU/changelog f CWRU/sh-redir-hack f + CWRU/empty-for-wordlist f CWRU/mh-folder-comp f doc/FAQ f *************** *** 356,359 **** --- 369,373 ---- support/printenv.c f support/bash.xbm f + support/missing f 755 support/mkclone f 755 support/mkconffiles f 755 *************** *** 369,374 **** support/install.sh f 755 support/texi2dvi f ! support/texi2html f support/xenix-link.sh f 755 examples/bashdb/PERMISSION f examples/bashdb/README f --- 383,390 ---- support/install.sh f 755 support/texi2dvi f ! support/texi2html f 755 support/xenix-link.sh f 755 + support/shobj-conf f 755 + support/rlvers.sh f 755 examples/bashdb/PERMISSION f examples/bashdb/README f *************** *** 377,380 **** --- 393,397 ---- examples/bashdb/bashdb.pre f examples/loadables/README f + examples/loadables/template.c f examples/loadables/Makefile.in f examples/loadables/necho.c f *************** *** 385,389 **** examples/loadables/truefalse.c f examples/loadables/getconf.c f - examples/loadables/pushd.c f examples/loadables/finfo.c f examples/loadables/cat.c f --- 402,405 ---- *************** *** 396,401 **** --- 412,426 ---- examples/loadables/rmdir.c f examples/loadables/head.c f + examples/loadables/printenv.c f + examples/loadables/id.c f + examples/loadables/whoami.c f + examples/loadables/uname.c f + examples/loadables/sync.c f + examples/loadables/mkdir.c f + examples/loadables/ln.c f + examples/loadables/unlink.c f examples/functions/autoload f examples/functions/autoload.v2 f + examples/functions/autoload.v3 f examples/functions/basename f examples/functions/basename2 f *************** *** 424,428 **** --- 449,455 ---- examples/functions/pathfuncs f examples/functions/repeat2 f + examples/functions/repeat3 f examples/functions/seq f + examples/functions/seq2 f examples/functions/shcat f examples/functions/shcat2 f *************** *** 432,435 **** --- 459,463 ---- examples/functions/whatis f examples/functions/whence f + examples/functions/which f examples/functions/xalias.bash f examples/scripts/adventure.sh f *************** *** 480,483 **** --- 508,513 ---- tests/cond.tests f tests/cond.right f + tests/cprint.tests f + tests/cprint.right f tests/dollar-at-star f tests/dollar.right f *************** *** 574,577 **** --- 604,608 ---- tests/run-builtins f tests/run-cond f + tests/run-cprint f tests/run-dirstack f tests/run-dollars f diff -aNrc2 bash-2.02.1/Makefile.in bash-2.03/Makefile.in *** bash-2.02.1/Makefile.in Thu Apr 16 11:35:05 1998 --- bash-2.03/Makefile.in Thu Feb 18 12:07:38 1999 *************** *** 1,3 **** ! # Makefile for bash-2.02, version 2.84 # # Make sure the first target in the makefile is the right one --- 1,3 ---- ! # Makefile for bash-2.03, version 2.103 # # Make sure the first target in the makefile is the right one *************** *** 30,37 **** CC_FOR_BUILD = @CC_FOR_BUILD@ YACC = @YACC@ ! SHELL=/bin/sh CP = cp RM = rm -f AR = @AR@ RANLIB = @RANLIB@ --- 30,38 ---- CC_FOR_BUILD = @CC_FOR_BUILD@ YACC = @YACC@ ! SHELL = @MAKE_SHELL@ CP = cp RM = rm -f AR = @AR@ + ARFLAGS = @ARFLAGS@ RANLIB = @RANLIB@ *************** *** 39,42 **** --- 40,44 ---- INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ + INSTALLMODE= -m 0755 COMPRESS = gzip *************** *** 64,67 **** --- 66,70 ---- Machine = @host_cpu@ OS = @host_os@ + VENDOR = @host_vendor@ MACHTYPE = @host@ *************** *** 81,98 **** LOCAL_DEFS = @LOCAL_DEFS@ LOCAL_LIBS = @LOCAL_LIBS@ ! LIBS = $(BUILTINS_LIB) $(LIBRARIES) $(LOCAL_LIBS) @LIBS@ ! LDFLAGS = @LDFLAGS@ $(LOCAL_LDFLAGS) $(PROFILE_FLAGS) $(CFLAGS) LOCAL_LDFLAGS = @LOCAL_LDFLAGS@ ! SYSTEM_FLAGS = -DPROGRAM='"$(Program)"' -DHOSTTYPE='"$(Machine)"' -DOSTYPE='"$(OS)"' -DMACHTYPE='"$(MACHTYPE)"' CCFLAGS = $(PROFILE_FLAGS) $(SYSTEM_FLAGS) $(LOCAL_DEFS) \ $(DEFS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) ! INCLUDES = -I. -I$(srcdir) -I$(LIBSRC) GCC_LINT_FLAGS = -ansi -Wall -Wshadow -Wpointer-arith -Wcast-qual \ -Wwrite-strings -Werror -Wstrict-prototypes \ ! -Wmissing-prototypes GCC_LINT_CFLAGS = $(CCFLAGS) $(GCC_LINT_FLAGS) --- 84,102 ---- LOCAL_DEFS = @LOCAL_DEFS@ LOCAL_LIBS = @LOCAL_LIBS@ ! LIBS = $(BUILTINS_LIB) $(LIBRARIES) @LIBS@ ! LDFLAGS = @LDFLAGS@ $(STATIC_LD) $(LOCAL_LDFLAGS) $(PROFILE_FLAGS) $(CFLAGS) ! STATIC_LD = @STATIC_LD@ LOCAL_LDFLAGS = @LOCAL_LDFLAGS@ ! SYSTEM_FLAGS = -DPROGRAM='"$(Program)"' -DCONF_HOSTTYPE='"$(Machine)"' -DCONF_OSTYPE='"$(OS)"' -DCONF_MACHTYPE='"$(MACHTYPE)"' -DCONF_VENDOR='"$(VENDOR)"' CCFLAGS = $(PROFILE_FLAGS) $(SYSTEM_FLAGS) $(LOCAL_DEFS) \ $(DEFS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) ! INCLUDES = -I. @RL_INCLUDE@ -I$(srcdir) -I$(LIBSRC) -I$(includedir) GCC_LINT_FLAGS = -ansi -Wall -Wshadow -Wpointer-arith -Wcast-qual \ -Wwrite-strings -Werror -Wstrict-prototypes \ ! -Wmissing-prototypes -Wno-implicit GCC_LINT_CFLAGS = $(CCFLAGS) $(GCC_LINT_FLAGS) *************** *** 106,110 **** LIBSRC = $(srcdir)/$(LIBSUBDIR) ! SUBDIR_INCLUDES = -I. -I$(topdir) -I$(topdir)/$(LIBSUBDIR) -I$(includedir) # the bash library --- 110,114 ---- LIBSRC = $(srcdir)/$(LIBSUBDIR) ! SUBDIR_INCLUDES = -I. @RL_INCLUDE@ -I$(topdir) -I$(topdir)/$(LIBSUBDIR) -I$(includedir) # the bash library *************** *** 121,125 **** ${SH_LIBSRC}/strtod.c ${SH_LIBSRC}/strtol.c \ ${SH_LIBSRC}/strtoul.c ${SH_LIBSRC}/vprint.c \ ! ${SH_LIBSRC}/itos.c SHLIB_LIB = -lsh --- 125,129 ---- ${SH_LIBSRC}/strtod.c ${SH_LIBSRC}/strtol.c \ ${SH_LIBSRC}/strtoul.c ${SH_LIBSRC}/vprint.c \ ! ${SH_LIBSRC}/itos.c ${SH_LIBSRC}/rename.c SHLIB_LIB = -lsh *************** *** 132,136 **** RL_LIBSRC = $(LIBSRC)/readline RL_LIBDOC = $(RL_LIBSRC)/doc ! RL_LIBDIR = $(dot)/$(LIBSUBDIR)/readline RL_ABSSRC = ${topdir}/$(RL_LIBDIR) --- 136,140 ---- RL_LIBSRC = $(LIBSRC)/readline RL_LIBDOC = $(RL_LIBSRC)/doc ! RL_LIBDIR = @RL_LIBDIR@ RL_ABSSRC = ${topdir}/$(RL_LIBDIR) *************** *** 146,149 **** --- 150,154 ---- $(RL_LIBSRC)/history.h $(RL_LIBSRC)/histlib.h \ $(RL_LIBSRC)/posixstat.h $(RL_LIBSRC)/tilde.h \ + $(RL_LIBSRC)/rlstdc.h \ $(RL_LIBSRC)/funmap.c $(RL_LIBSRC)/emacs_keymap.c \ $(RL_LIBSRC)/search.c $(RL_LIBSRC)/vi_keymap.c \ *************** *** 158,162 **** $(RL_LIBSRC)/terminal.c $(RL_LIBSRC)/nls.c \ $(RL_LIBSRC)/input.c $(RL_LIBSRC)/xmalloc.c \ ! $(RL_LIBSRC)/shell.c \ $(RL_LIBSRC)/histexpand.c $(RL_LIBSRC)/history.c \ $(RL_LIBSRC)/histsearch.c $(RL_LIBSRC)/histfile.c --- 163,167 ---- $(RL_LIBSRC)/terminal.c $(RL_LIBSRC)/nls.c \ $(RL_LIBSRC)/input.c $(RL_LIBSRC)/xmalloc.c \ ! $(RL_LIBSRC)/shell.c $(RL_LIBSRC)/savestring.c \ $(RL_LIBSRC)/histexpand.c $(RL_LIBSRC)/history.c \ $(RL_LIBSRC)/histsearch.c $(RL_LIBSRC)/histfile.c *************** *** 172,181 **** $(RL_LIBDIR)/macro.o $(RL_LIBDIR)/input.o \ $(RL_LIBDIR)/terminal.o $(RL_LIBDIR)/callback.o \ ! $(RL_LIBDIR)/shell.o \ $(RL_LIBDIR)/history.o $(RL_LIBDIR)/histexpand.o \ $(RL_LIBDIR)/histsearch.o $(RL_LIBDIR)/histfile.o HIST_LIBSRC = $(LIBSRC)/readline ! HIST_LIBDIR = $(dot)/$(LIBSUBDIR)/readline HIST_ABSSRC = ${topdir}/$(HIST_LIBDIR) --- 177,186 ---- $(RL_LIBDIR)/macro.o $(RL_LIBDIR)/input.o \ $(RL_LIBDIR)/terminal.o $(RL_LIBDIR)/callback.o \ ! $(RL_LIBDIR)/shell.o $(RL_LIBDIR)/savestring.o \ $(RL_LIBDIR)/history.o $(RL_LIBDIR)/histexpand.o \ $(RL_LIBDIR)/histsearch.o $(RL_LIBDIR)/histfile.o HIST_LIBSRC = $(LIBSRC)/readline ! HIST_LIBDIR = @HIST_LIBDIR@ HIST_ABSSRC = ${topdir}/$(HIST_LIBDIR) *************** *** 266,274 **** $(TILDE_LIB) $(MALLOC_LIB) $(SHLIB_LIB) $(LOCAL_LIBS) ! LIBDEP = $(READLINE_DEP) $(TERMCAP_DEP) $(GLOB_DEP) $(HISTORY_DEP) \ $(TILDE_DEP) $(MALLOC_DEP) $(SHLIB_DEP) ! LIBRARY_LDFLAGS = $(READLINE_LDFLAGS) $(HISTORY_LDFLAGS) $(TILDE_LDFLAGS) \ ! $(GLOB_LDFLAGS) $(MALLOC_LDFLAGS) $(SHLIB_LDFLAGS) # --- 271,279 ---- $(TILDE_LIB) $(MALLOC_LIB) $(SHLIB_LIB) $(LOCAL_LIBS) ! LIBDEP = $(READLINE_DEP) $(HISTORY_DEP) $(TERMCAP_DEP) $(GLOB_DEP) \ $(TILDE_DEP) $(MALLOC_DEP) $(SHLIB_DEP) ! LIBRARY_LDFLAGS = $(READLINE_LDFLAGS) $(HISTORY_LDFLAGS) $(GLOB_LDFLAGS) \ ! $(TILDE_LDFLAGS) $(MALLOC_LDFLAGS) $(SHLIB_LDFLAGS) # *************** *** 412,417 **** version.h: $(SOURCES) config.h Makefile ! if $(SHELL) $(SUPPORT_SRC)mkversion.sh -b -s $(RELSTATUS) -d $(Version) -p $(PatchLevel) -o newversion.h; \ ! then mv newversion.h version.h; fi; # old rules --- 417,422 ---- version.h: $(SOURCES) config.h Makefile ! $(SHELL) $(SUPPORT_SRC)mkversion.sh -b -s $(RELSTATUS) -d $(Version) -p $(PatchLevel) -o newversion.h \ ! && mv newversion.h version.h # old rules *************** *** 436,446 **** $(READLINE_LIBRARY): config.h $(READLINE_SOURCE) @echo making $@ in ${RL_LIBDIR} ! @(cd ${RL_LIBDIR} && \ ! $(MAKE) $(MFLAGS) libreadline.a) || exit 1 $(HISTORY_LIBRARY): config.h $(HISTORY_SOURCE) @echo making $@ in ${HIST_LIBDIR} ! @(cd ${HIST_LIBDIR} && \ ! $(MAKE) $(MFLAGS) libhistory.a) || exit 1 $(GLOB_LIBRARY): config.h $(GLOB_SOURCE) --- 441,451 ---- $(READLINE_LIBRARY): config.h $(READLINE_SOURCE) @echo making $@ in ${RL_LIBDIR} ! @( { test "${RL_LIBDIR}" = "${libdir}" && exit 0; } || \ ! cd ${RL_LIBDIR} && $(MAKE) $(MFLAGS) libreadline.a) || exit 1 $(HISTORY_LIBRARY): config.h $(HISTORY_SOURCE) @echo making $@ in ${HIST_LIBDIR} ! @( { test "${HIST_LIBDIR}" = "${libdir}" && exit 0; } || \ ! cd ${HIST_LIBDIR} && $(MAKE) $(MFLAGS) libhistory.a) || exit 1 $(GLOB_LIBRARY): config.h $(GLOB_SOURCE) *************** *** 465,469 **** mksignames: $(SUPPORT_SRC)mksignames.c ! $(CC) $(CCFLAGS) $(CPPFLAGS) -o $@ $(SUPPORT_SRC)mksignames.c # make a list of signals for the local system -- this is done when we're --- 470,474 ---- mksignames: $(SUPPORT_SRC)mksignames.c ! $(CC_FOR_BUILD) $(CCFLAGS) $(CPPFLAGS) -o $@ $(SUPPORT_SRC)mksignames.c # make a list of signals for the local system -- this is done when we're *************** *** 503,507 **** config.h: stamp-h ! stamp-h: config.status $(srcdir)/config.h.in $(srcdir)/config.h.top $(srcdir)/config.h.bot CONFIG_FILES= CONFIG_HEADERS=config.h $(SHELL) ./config.status --- 508,512 ---- config.h: stamp-h ! stamp-h: config.status $(srcdir)/config.h.in $(srcdir)/config-top.h $(srcdir)/config-bot.h CONFIG_FILES= CONFIG_HEADERS=config.h $(SHELL) ./config.status *************** *** 510,515 **** # comment out for distribution ! #$(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/aclocal.m4 ! # cd $(srcdir) && autoconf #newversion: mkversion --- 515,524 ---- # comment out for distribution ! $(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/aclocal.m4 $(srcdir)/config.h.in ! cd $(srcdir) && autoconf ! ! # for chet ! reconfig: force ! sh $(srcdir)/configure #newversion: mkversion *************** *** 541,546 **** install: .made installdirs ! $(INSTALL_PROGRAM) $(Program) $(bindir)/$(Program) ! $(INSTALL_PROGRAM) bashbug $(bindir)/bashbug -( cd $(DOCDIR) ; $(MAKE) $(MFLAGS) \ man1dir=$(man1dir) man1ext=$(man1ext) \ --- 550,555 ---- install: .made installdirs ! $(INSTALL_PROGRAM) $(INSTALLMODE) $(Program) $(bindir)/$(Program) ! $(INSTALL_PROGRAM) $(INSTALLMODE) bashbug $(bindir)/bashbug -( cd $(DOCDIR) ; $(MAKE) $(MFLAGS) \ man1dir=$(man1dir) man1ext=$(man1ext) \ *************** *** 573,576 **** --- 582,586 ---- -(cd $(TILDE_LIBDIR) && $(MAKE) $(MFLAGS) $@) -(cd $(ALLOC_LIBDIR) && $(MAKE) $(MFLAGS) $@) + -(cd $(SH_LIBDIR) && $(MAKE) $(MFLAGS) $@) $(RM) $(CREATED_SUPPORT) *************** *** 584,587 **** --- 594,598 ---- -(cd $(TILDE_LIBDIR) && $(MAKE) $(MFLAGS) $@) -(cd $(ALLOC_LIBDIR) && $(MAKE) $(MFLAGS) $@) + -(cd $(SH_LIBDIR) && $(MAKE) $(MFLAGS) $@) distclean: basic-clean *************** *** 594,597 **** --- 605,609 ---- -(cd $(TILDE_LIBDIR) && $(MAKE) $(MFLAGS) $@) -(cd $(ALLOC_LIBDIR) && $(MAKE) $(MFLAGS) $@) + -(cd $(SH_LIBDIR) && $(MAKE) $(MFLAGS) $@) $(RM) $(CREATED_CONFIGURE) tags TAGS $(RM) $(CREATED_SUPPORT) Makefile $(CREATED_MAKEFILES) *************** *** 609,612 **** --- 621,625 ---- -(cd $(TILDE_LIBDIR) && $(MAKE) $(MFLAGS) $@) -(cd $(ALLOC_LIBDIR) && $(MAKE) $(MFLAGS) $@) + -(cd $(SH_LIBDIR) && $(MAKE) $(MFLAGS) $@) $(RM) $(CREATED_CONFIGURE) $(CREATED_MAKEFILES) $(RM) $(CREATED_SUPPORT) Makefile *************** *** 644,663 **** ############################ DEPENDENCIES ############################### ! # Files that depend on the definitions in config.h.top, which are not meant # to be changed ! shell.o: config.h.top ! input.o: config.h.top ! y.tab.o: config.h.top ! jobs.o: config.h.top ! nojobs.o: config.h.top ! execute_cmd.o: config.h.top ! variables.o: config.h.top ! builtins/command.o: config.h.top ! builtins/common.o: config.h.top ! builtins/break.o: config.h.top ! builtins/echo.o: config.h.top ! builtins/evalstring.o: config.h.top ! builtins/exit.o: config.h.top ! builtins/kill.o: config.h.top # shell basics --- 657,676 ---- ############################ DEPENDENCIES ############################### ! # Files that depend on the definitions in config-top.h, which are not meant # to be changed ! shell.o: config-top.h ! input.o: config-top.h ! y.tab.o: config-top.h ! jobs.o: config-top.h ! nojobs.o: config-top.h ! execute_cmd.o: config-top.h ! variables.o: config-top.h ! builtins/command.o: config-top.h ! builtins/common.o: config-top.h ! builtins/break.o: config-top.h ! builtins/echo.o: config-top.h ! builtins/evalstring.o: config-top.h ! builtins/exit.o: config-top.h ! builtins/kill.o: config-top.h # shell basics *************** *** 873,888 **** bashline.o: $(RL_LIBSRC)/rlconf.h ! bashline.o: $(RL_LIBSRC)/keymaps.h bashline.o: $(RL_LIBSRC)/chardefs.h $(RL_LIBSRC)/readline.h bracecomp.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h ! bracecomp.o: $(RL_LIBSRC)/readline.h ! y.tab.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h $(RL_LIBSRC)/readline.h ! subst.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h $(RL_LIBSRC)/readline.h ! ! shell.o: $(HIST_LIBSRC)/history.h ! subst.o: $(HIST_LIBSRC)/history.h ! bashline.o: $(HIST_LIBSRC)/history.h ! bashhist.o: $(HIST_LIBSRC)/history.h ! y.tab.o: $(HIST_LIBSRC)/history.h execute_cmd.o: $(TILDE_LIBSRC)/tilde.h --- 886,903 ---- bashline.o: $(RL_LIBSRC)/rlconf.h ! bashline.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/rlstdc.h bashline.o: $(RL_LIBSRC)/chardefs.h $(RL_LIBSRC)/readline.h bracecomp.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h ! bracecomp.o: $(RL_LIBSRC)/readline.h $(RL_LIBSRC)/rlstdc.h ! y.tab.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h ! y.tab.o: $(RL_LIBSRC)/readline.h $(RL_LIBSRC)/rlstdc.h ! subst.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h ! subst.o: $(RL_LIBSRC)/readline.h $(RL_LIBSRC)/rlstdc.h ! ! shell.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h ! subst.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h ! bashline.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h ! bashhist.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h ! y.tab.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h execute_cmd.o: $(TILDE_LIBSRC)/tilde.h *************** *** 1076,1084 **** # builtin library dependencies builtins/bind.o: $(RL_LIBSRC)/chardefs.h $(RL_LIBSRC)/readline.h ! builtins/bind.o: $(RL_LIBSRC)/keymaps.h ! builtins/bind.o: $(HIST_LIBSRC)/history.h ! builtins/fc.o: $(HIST_LIBSRC)/history.h ! builtins/history.o: $(HIST_LIBSRC)/history.h builtins/common.o: $(TILDE_LIBSRC)/tilde.h --- 1091,1099 ---- # builtin library dependencies builtins/bind.o: $(RL_LIBSRC)/chardefs.h $(RL_LIBSRC)/readline.h ! builtins/bind.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/rlstdc.h ! builtins/bind.o: $(HIST_LIBSRC)/history.h $(RL_LIBSRC)/rlstdc.h ! builtins/fc.o: $(HIST_LIBSRC)/history.h $(RL_LIBSRC)/rlstdc.h ! builtins/history.o: $(HIST_LIBSRC)/history.h $(RL_LIBSRC)/rlstdc.h builtins/common.o: $(TILDE_LIBSRC)/tilde.h diff -aNrc2 bash-2.02.1/NEWS bash-2.03/NEWS *** bash-2.02.1/NEWS Fri Apr 17 15:52:44 1998 --- bash-2.03/NEWS Fri Feb 19 12:11:39 1999 *************** *** 1,2 **** --- 1,68 ---- + This is a terse description of the new features added to bash-2.03 since + the release of bash-2.02. As always, the manual page (doc/bash.1) is + the place to look for complete descriptions. + + 1. New Features in Bash + + a. New `shopt' option, `restricted_shell', indicating whether or not the + shell was started in restricted mode, for use in startup files. + + b. Filename generation is now performed on the words between ( and ) in + array assignments (which it probably should have done all along). + + c. OLDPWD is now auto-exported, as POSIX.2 seems to require. + + d. ENV and BASH_ENV are read-only variables in a restricted shell. + + e. A change was made to the startup file code so that any shell begun with + the `--login' option, even non-interactive shells, will source the login + shell startup files. + + 2. New Features in Readline + + a. Many changes to the signal handling: + o Readline now catches SIGQUIT and cleans up the tty before returning; + o A new variable, rl_catch_signals, is available to application writers + to indicate to readline whether or not it should install its own + signal handlers for SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, + SIGTTIN, and SIGTTOU; + o A new variable, rl_catch_sigwinch, is available to application + writers to indicate to readline whether or not it should install its + own signal handler for SIGWINCH, which will chain to the calling + applications's SIGWINCH handler, if one is installed; + o There is a new function, rl_free_line_state, for application signal + handlers to call to free up the state associated with the current + line after receiving a signal; + o There is a new function, rl_cleanup_after_signal, to clean up the + display and terminal state after receiving a signal; + o There is a new function, rl_reset_after_signal, to reinitialize the + terminal and display state after an application signal handler + returns and readline continues + + b. There is a new function, rl_resize_terminal, to reset readline's idea of + the screen size after a SIGWINCH. + + c. New public functions: rl_save_prompt and rl_restore_prompt. These were + previously private functions with a `_' prefix. + + d. New function hook: rl_pre_input_hook, called just before readline starts + reading input, after initialization. + + e. New function hook: rl_display_matches_hook, called when readline would + display the list of completion matches. The new function + rl_display_match_list is what readline uses internally, and is available + for use by application functions called via this hook. + + f. New bindable function, delete-char-or-list, like tcsh. + + g. A new variable, rl_erase_empty_line, which, if set by an application using + readline, will cause readline to erase, prompt and all, lines on which the + only thing typed was a newline. + + h. New bindable variable: `isearch-terminators'. + + i. New bindable function: `forward-backward-delete-char' (unbound by default). + + ------------------------------------------------------------------------------- This is a terse description of the new features added to bash-2.02 since the release of bash-2.01.1. As always, the manual page (doc/bash.1) is diff -aNrc2 bash-2.02.1/NOTES bash-2.03/NOTES *** bash-2.02.1/NOTES Fri Jul 10 12:32:12 1998 --- bash-2.03/NOTES Wed Jan 13 14:22:12 1999 *************** *** 199,200 **** --- 199,255 ---- warning: unknown s_type: 98 I have no idea what this means, but it doesn't seem to matter. + + 10. If you do not have /usr/ccs/bin in your PATH when building on SunOS 5.x + (Solaris 2), the configure script will be unable to find `ar' and + `ranlib' (of course, ranlib is unnecessary). Make sure your $PATH + includes /usr/ccs/bin on SunOS 5.x. + + 11. Building a statically-linked bash on Solaris 2.5.x or 2.6 is complicated. + It's not possible to build a completely statically-linked binary, since + part of the C library depends on dynamic linking. The following recipe + assumes that you're using gcc and the Solaris ld (/usr/ccs/bin/ld). + + configure --enable-static-link + make STATIC_LD= LOCAL_LIBS='-Wl,-B,dynamic -ldl -Wl,-B,static' + + This should result in a bash binary that depends only on libdl.so: + + thor(2)$ ldd bash + libdl.so.1 => /usr/lib/libdl.so.1 + + If you're using the Sun C Compiler (Sun WorkShop C Compiler version + 4.2 was what I used), you should be able to get away with using + + configure --enable-static-link + make STATIC_LD= LOCAL_LIBS='-B dynamic -ldl -B static' + + If you want to completely remove any dependence on /usr, perhaps + to put a copy of bash in /sbin and have it available when /usr is + not mounted, force the build process to use the shared ld.so library + in /etc/lib. + + For gcc, this would be something like + + configure --enable-static-link + make STATIC_LD= LOCAL_LIBS='-Wl,-B,dynamic -Wl,-R/etc/lib -ldl -Wl,-B,static' + + For Sun's WS4.2 cc + + configure --enable-static-link + make STATIC_LD= LOCAL_LIBS='-B dynamic -R/etc/lib -ldl -B static' + + seems to work, at least on Solaris 2.5.1: + + thor(2)$ ldd bash + libdl.so.1 => /etc/lib/libdl.so.1 + + 12. Configuring bash to build it in a cross environment. Currently only + two native versions can be compiled this way, cygwin32 and x86 BeOS. + For BeOS, you would configure it like this: + + export RANLIB=i586-beos-ranlib + export AR=i586-beos-ar + export CC=i586-beos-gcc + configure i586-beos + + Similarly for cygwin32. diff -aNrc2 bash-2.02.1/README bash-2.03/README *** bash-2.02.1/README Thu Jul 23 10:37:26 1998 --- bash-2.03/README Thu Nov 19 11:52:05 1998 *************** *** 2,6 **** ============ ! This is GNU Bash, version 2.02.1. Bash is the GNU Project's Bourne Again SHell, a complete implementation of the POSIX.2 shell spec, but also with interactive command line editing, job control on --- 2,6 ---- ============ ! This is GNU Bash, version 2.03. Bash is the GNU Project's Bourne Again SHell, a complete implementation of the POSIX.2 shell spec, but also with interactive command line editing, job control on *************** *** 50,54 **** ============== ! Bug reports for bash-2.02.1 should be sent to: bug-bash@prep.ai.mit.edu --- 50,54 ---- ============== ! Bug reports for bash should be sent to: bug-bash@prep.ai.mit.edu *************** *** 68,72 **** information: ! * the version number and release status of Bash (e.g., 2.02.1-release) * the machine and OS that it is running on (look at the file `.made' in the bash build directory) --- 68,72 ---- information: ! * the version number and release status of Bash (e.g., 2.01-release) * the machine and OS that it is running on (look at the file `.made' in the bash build directory) diff -aNrc2 bash-2.02.1/Y2K bash-2.03/Y2K *** bash-2.02.1/Y2K Wed Dec 31 19:00:00 1969 --- bash-2.03/Y2K Tue Jan 26 16:57:06 1999 *************** *** 0 **** --- 1,5 ---- + Since Bash does not manipulate date strings, it is Y2K-safe. + + The only thing that Bash does with date strings is manipulate the string + returned by ctime(3) in the prompt customization code. In all cases, + it discards the year. diff -aNrc2 bash-2.02.1/aclocal.m4 bash-2.03/aclocal.m4 *** bash-2.02.1/aclocal.m4 Fri Mar 27 12:04:31 1998 --- bash-2.03/aclocal.m4 Wed Dec 30 11:06:41 1998 *************** *** 27,31 **** } ], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no, ! [AC_MSG_ERROR(cannot check dup2 if cross compiling -- defaulting to no) bash_cv_dup2_broken=no]) ]) --- 27,31 ---- } ], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no, ! [AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no) bash_cv_dup2_broken=no]) ]) *************** *** 130,134 **** } ], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes, ! [AC_MSG_ERROR(cannot check pgrp synchronization if cross compiling -- defaulting to no) bash_cv_pgrp_pipe=no]) ]) --- 130,134 ---- } ], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes, ! [AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no) bash_cv_pgrp_pipe=no]) ]) *************** *** 188,192 **** exit(1); }], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long, ! [AC_MSG_ERROR(cannot check quad_t if cross compiling -- defaulting to long) bash_cv_type_rlimit=long])]) ]) --- 188,192 ---- exit(1); }], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long, ! [AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long) bash_cv_type_rlimit=long])]) ]) *************** *** 212,216 **** #endif], [ char *msg = _sys_siglist[2]; ], bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no, ! [AC_MSG_ERROR(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl AC_MSG_RESULT($bash_cv_decl_under_sys_siglist) if test $bash_cv_decl_under_sys_siglist = yes; then --- 212,216 ---- #endif], [ char *msg = _sys_siglist[2]; ], bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no, ! [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl AC_MSG_RESULT($bash_cv_decl_under_sys_siglist) if test $bash_cv_decl_under_sys_siglist = yes; then *************** *** 238,242 **** }], bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no, ! [AC_MSG_ERROR(cannot check for _sys_siglist[] if cross compiling -- defaulting to no) bash_cv_under_sys_siglist=no])]) AC_MSG_RESULT($bash_cv_under_sys_siglist) --- 238,242 ---- }], bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no, ! [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no) bash_cv_under_sys_siglist=no])]) AC_MSG_RESULT($bash_cv_under_sys_siglist) *************** *** 265,269 **** }], bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no, ! [AC_MSG_ERROR(cannot check for sys_siglist if cross compiling -- defaulting to no) bash_cv_sys_siglist=no])]) AC_MSG_RESULT($bash_cv_sys_siglist) --- 265,269 ---- }], bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no, ! [AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no) bash_cv_sys_siglist=no])]) AC_MSG_RESULT($bash_cv_sys_siglist) *************** *** 326,330 **** exit (dir == 0); }], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no, ! [AC_MSG_ERROR(cannot check opendir if cross compiling -- defaulting to no) bash_cv_opendir_not_robust=no] )]) --- 326,330 ---- exit (dir == 0); }], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no, ! [AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no) bash_cv_opendir_not_robust=no] )]) *************** *** 357,391 **** AC_DEFUN(BASH_TYPE_INT32_T, [ ! if test "X$bash_cv_type_int32_t" = "X"; then ! _bash_needmsg=yes else ! AC_MSG_CHECKING(which builtin C type is 32 bits wide) ! _bash_needmsg= ! fi ! AC_CACHE_VAL(bash_cv_type_int32_t, ! [AC_TRY_RUN([ ! main() ! { ! #if SIZEOF_INT == 4 ! exit (0); ! #else ! # if SIZEOF_LONG == 4 ! exit (1); ! # else ! # error cannot find 32 bit type... ! # endif ! #endif ! }], bash_cv_type_int32_t=int, bash_cv_type_int32_t=long, ! [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int) ! bash_cv_type_int32_t=int] ! )]) ! if test "X$_bash_needmsg" = "Xyes"; then ! AC_MSG_CHECKING(which builtin C type is 32 bits wide) ! fi ! AC_MSG_RESULT($bash_cv_type_int32_t); ! if test "$bash_cv_type_int32_t" = "int"; then ! AC_DEFINE(int32_t, int) ! else ! AC_DEFINE(int32_t, long) fi ]) --- 357,366 ---- AC_DEFUN(BASH_TYPE_INT32_T, [ ! if test "$ac_cv_sizeof_int" = 4; then ! AC_CHECK_TYPE(int32_t, int) ! elif test "$ac_cv_sizeof_long" = 4; then ! AC_CHECK_TYPE(int32_t, long) else ! AC_CHECK_TYPE(int32_t, int) fi ]) *************** *** 393,427 **** AC_DEFUN(BASH_TYPE_U_INT32_T, [ ! if test "X$bash_cv_type_u_int32_t" = "X"; then ! _bash_needmsg=yes ! else ! AC_MSG_CHECKING(which unsigned builtin C type is 32 bits wide) ! _bash_needmsg= ! fi ! AC_CACHE_VAL(bash_cv_type_u_int32_t, ! [AC_TRY_RUN([ ! main() ! { ! #if SIZEOF_INT == 4 ! exit (0); ! #else ! # if SIZEOF_LONG == 4 ! exit (1); ! # else ! # error cannot find 32 bit type... ! # endif ! #endif ! }], bash_cv_type_u_int32_t=int, bash_cv_type_u_int32_t=long, ! [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int) ! bash_cv_type_u_int32_t=int] ! )]) ! if test "X$_bash_needmsg" = "Xyes"; then ! AC_MSG_CHECKING(which unsigned builtin C type is 32 bits wide) ! fi ! AC_MSG_RESULT($bash_cv_type_u_int32_t); ! if test "$bash_cv_type_u_int32_t" = "int"; then ! AC_DEFINE(u_int32_t, unsigned int) else ! AC_DEFINE(u_int32_t, unsigned long) fi ]) --- 368,377 ---- AC_DEFUN(BASH_TYPE_U_INT32_T, [ ! if test "$ac_cv_sizeof_int" = 4; then ! AC_CHECK_TYPE(u_int32_t, unsigned int) ! elif test "$ac_cv_sizeof_long" = 4; then ! AC_CHECK_TYPE(u_int32_t, unsigned long) else ! AC_CHECK_TYPE(u_int32_t, unsigned int) fi ]) *************** *** 429,463 **** AC_DEFUN(BASH_TYPE_PTRDIFF_T, [ ! if test "X$bash_cv_type_ptrdiff_t" = "X"; then ! _bash_needmsg=yes else ! AC_MSG_CHECKING(which builtin C type is correct for ptrdiff_t) ! _bash_needmsg= fi ! AC_CACHE_VAL(bash_cv_type_ptrdiff_t, ! [AC_TRY_RUN([ ! main() ! { ! #if SIZEOF_CHAR_P == SIZEOF_INT ! exit (0); ! #else ! # if SIZEOF_CHAR_P == SIZEOF_LONG ! exit (1); ! # else ! # error cannot find type for pointer arithmetic... ! # endif ! #endif ! }], bash_cv_type_ptrdiff_t=int, bash_cv_type_ptrdiff_t=long, ! [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int) ! bash_cv_type_ptrdiff_t=int] ! )]) ! if test "X$_bash_needmsg" = "Xyes"; then ! AC_MSG_CHECKING(which builtin C type is correct for ptrdiff_t) ! fi ! AC_MSG_RESULT($bash_cv_type_ptrdiff_t); ! if test "$bash_cv_type_ptrdiff_t" = "int"; then ! AC_DEFINE(ptrdiff_t, int) else ! AC_DEFINE(ptrdiff_t, long) fi ]) --- 379,401 ---- AC_DEFUN(BASH_TYPE_PTRDIFF_T, [ ! if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then ! AC_CHECK_TYPE(ptrdiff_t, int) ! elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then ! AC_CHECK_TYPE(ptrdiff_t, long) else ! AC_CHECK_TYPE(ptrdiff_t, int) fi ! ]) ! ! AC_DEFUN(BASH_TYPE_BITS64_T, ! [ ! if test "$ac_sv_sizeof_char_p" = 8; then ! AC_CHECK_TYPE(bits64_t, char *) ! elif test "$ac_cv_sizeof_double" = 8; then ! AC_CHECK_TYPE(bits64_t, double) ! elif test "$ac_cv_sizeof_long" = 8; then ! AC_CHECK_TYPE(bits64_t, long) else ! AC_CHECK_TYPE(bits64_t, double) fi ]) *************** *** 549,553 **** } ], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no, ! [AC_MSG_ERROR(cannot check getenv redefinition if cross compiling -- defaulting to yes) bash_cv_getenv_redef=yes] )]) --- 487,491 ---- } ], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no, ! [AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes) bash_cv_getenv_redef=yes] )]) *************** *** 575,579 **** } ], bash_cv_printf_declared=yes, bash_cv_printf_declared=no, ! [AC_MSG_ERROR(cannot check printf declaration if cross compiling -- defaulting to yes) bash_cv_printf_declared=yes] )]) --- 513,517 ---- } ], bash_cv_printf_declared=yes, bash_cv_printf_declared=no, ! [AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes) bash_cv_printf_declared=yes] )]) *************** *** 594,598 **** } ], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no, ! [AC_MSG_ERROR(cannot check ulimit if cross compiling -- defaulting to no) bash_cv_ulimit_maxfds=no] )]) --- 532,536 ---- } ], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no, ! [AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no) bash_cv_ulimit_maxfds=no] )]) *************** *** 691,695 **** } ], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes, ! [AC_MSG_ERROR(cannot check whether getcwd calls popen if cross compiling -- defaulting to no) bash_cv_getcwd_calls_popen=no] )]) --- 629,633 ---- } ], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes, ! [AC_MSG_WARN(cannot check whether getcwd calls popen if cross compiling -- defaulting to no) bash_cv_getcwd_calls_popen=no] )]) *************** *** 815,819 **** } ], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes, ! [AC_MSG_ERROR(cannot check signal handling if cross compiling -- defaulting to no) bash_cv_must_reinstall_sighandlers=no] )]) --- 753,757 ---- } ], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes, ! [AC_MSG_WARN(cannot check signal handling if cross compiling -- defaulting to no) bash_cv_must_reinstall_sighandlers=no] )]) *************** *** 884,888 **** exit(0); }], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing, ! [AC_MSG_ERROR(cannot check job control if cross-compiling -- defaulting to missing) bash_cv_job_control_missing=missing] )]) --- 822,826 ---- exit(0); }], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing, ! [AC_MSG_WARN(cannot check job control if cross-compiling -- defaulting to missing) bash_cv_job_control_missing=missing] )]) *************** *** 929,933 **** exit(0); }], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing, ! [AC_MSG_ERROR(cannot check for named pipes if cross-compiling -- defaulting to missing) bash_cv_sys_named_pipes=missing] )]) --- 867,871 ---- exit(0); }], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing, ! [AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing) bash_cv_sys_named_pipes=missing] )]) *************** *** 980,984 **** #endif }], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing, ! [AC_MSG_ERROR(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing) bash_cv_func_sigsetjmp=missing] )]) --- 918,922 ---- #endif }], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing, ! [AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing) bash_cv_func_sigsetjmp=missing] )]) *************** *** 1247,1251 **** } ], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no, ! [AC_MSG_ERROR(cannot check strcoll if cross compiling -- defaulting to no) bash_cv_func_strcoll_broken=no] )]) --- 1185,1189 ---- } ], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no, ! [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no) bash_cv_func_strcoll_broken=no] )]) *************** *** 1337,1341 **** } ], bash_cv_sys_restartable_syscalls=yes, bash_cv_sys_restartable_syscalls=no, ! AC_MSG_ERROR(cannot check restartable syscalls if cross compiling)) ]) if test $bash_cv_sys_restartable_syscalls = yes; then --- 1275,1279 ---- } ], bash_cv_sys_restartable_syscalls=yes, bash_cv_sys_restartable_syscalls=no, ! AC_MSG_WARN(cannot check restartable syscalls if cross compiling)) ]) if test $bash_cv_sys_restartable_syscalls = yes; then *************** *** 1343,1344 **** --- 1281,1301 ---- fi ]) + dnl + dnl Check for 64-bit off_t -- used for malloc alignment + dnl + dnl C does not allow duplicate case labels, so the compile will fail if + dnl sizeof(off_t) is > 4. + dnl + AC_DEFUN(BASH_CHECK_OFF_T_64, + [AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64, + AC_TRY_COMPILE([ + #ifdef HAVE_UNISTD_H + #include + #endif + #include + ],[ + switch (0) case 0: case (sizeof (off_t) <= 4):; + ], bash_cv_off_t_64=no, bash_cv_off_t_64=yes)) + if test $bash_cv_off_t_64 = yes; then + AC_DEFINE(HAVE_OFF_T_64) + fi]) diff -aNrc2 bash-2.02.1/bashhist.c bash-2.03/bashhist.c *** bash-2.02.1/bashhist.c Fri Feb 27 12:34:33 1998 --- bash-2.03/bashhist.c Wed Oct 7 12:09:26 1998 *************** *** 290,294 **** if (stat (filename, &buf) == -1 && errno == ENOENT) { ! fd = open (filename, O_WRONLY|O_CREAT, 0666); if (fd < 0) { --- 290,294 ---- if (stat (filename, &buf) == -1 && errno == ENOENT) { ! fd = open (filename, O_WRONLY|O_CREAT, 0600); if (fd < 0) { *************** *** 325,329 **** { int file; ! file = open (hf, O_CREAT | O_TRUNC | O_WRONLY, 0666); if (file != -1) close (file); --- 325,329 ---- { int file; ! file = open (hf, O_CREAT | O_TRUNC | O_WRONLY, 0600); if (file != -1) close (file); diff -aNrc2 bash-2.02.1/bashline.c bash-2.03/bashline.c *** bash-2.02.1/bashline.c Tue Jun 30 12:37:13 1998 --- bash-2.03/bashline.c Wed Sep 16 15:12:58 1998 *************** *** 240,287 **** #if defined (BRACE_COMPLETION) ! rl_add_defun ("complete-into-braces", bash_brace_completion, -1); ! rl_bind_key_in_map ('{', bash_brace_completion, emacs_meta_keymap); #endif /* BRACE_COMPLETION */ #if defined (SPECIFIC_COMPLETION_FUNCTIONS) ! rl_add_defun ("complete-filename", bash_complete_filename, -1); ! rl_bind_key_in_map ('/', bash_complete_filename, emacs_meta_keymap); rl_add_defun ("possible-filename-completions", ! bash_possible_filename_completions, -1); ! rl_bind_key_in_map ('/', bash_possible_filename_completions, emacs_ctlx_keymap); ! rl_add_defun ("complete-username", bash_complete_username, -1); ! rl_bind_key_in_map ('~', bash_complete_username, emacs_meta_keymap); rl_add_defun ("possible-username-completions", ! bash_possible_username_completions, -1); ! rl_bind_key_in_map ('~', bash_possible_username_completions, emacs_ctlx_keymap); ! rl_add_defun ("complete-hostname", bash_complete_hostname, -1); ! rl_bind_key_in_map ('@', bash_complete_hostname, emacs_meta_keymap); rl_add_defun ("possible-hostname-completions", ! bash_possible_hostname_completions, -1); ! rl_bind_key_in_map ('@', bash_possible_hostname_completions, emacs_ctlx_keymap); ! rl_add_defun ("complete-variable", bash_complete_variable, -1); ! rl_bind_key_in_map ('$', bash_complete_variable, emacs_meta_keymap); rl_add_defun ("possible-variable-completions", ! bash_possible_variable_completions, -1); ! rl_bind_key_in_map ('$', bash_possible_variable_completions, emacs_ctlx_keymap); ! rl_add_defun ("complete-command", bash_complete_command, -1); ! rl_bind_key_in_map ('!', bash_complete_command, emacs_meta_keymap); rl_add_defun ("possible-command-completions", ! bash_possible_command_completions, -1); ! rl_bind_key_in_map ('!', bash_possible_command_completions, emacs_ctlx_keymap); ! rl_add_defun ("glob-expand-word", bash_glob_expand_word, -1); ! rl_add_defun ("glob-list-expansions", bash_glob_list_expansions, -1); ! rl_bind_key_in_map ('*', bash_glob_expand_word, emacs_ctlx_keymap); ! rl_bind_key_in_map ('g', bash_glob_list_expansions, emacs_ctlx_keymap); #endif /* SPECIFIC_COMPLETION_FUNCTIONS */ ! rl_add_defun ("dynamic-complete-history", dynamic_complete_history, -1); ! rl_bind_key_in_map (TAB, dynamic_complete_history, emacs_meta_keymap); /* Tell the completer that we want a crack first. */ --- 240,287 ---- #if defined (BRACE_COMPLETION) ! rl_add_defun ("complete-into-braces", (Function *)bash_brace_completion, -1); ! rl_bind_key_in_map ('{', (Function *)bash_brace_completion, emacs_meta_keymap); #endif /* BRACE_COMPLETION */ #if defined (SPECIFIC_COMPLETION_FUNCTIONS) ! rl_add_defun ("complete-filename", (Function *)bash_complete_filename, -1); ! rl_bind_key_in_map ('/', (Function *)bash_complete_filename, emacs_meta_keymap); rl_add_defun ("possible-filename-completions", ! (Function *)bash_possible_filename_completions, -1); ! rl_bind_key_in_map ('/', (Function *)bash_possible_filename_completions, emacs_ctlx_keymap); ! rl_add_defun ("complete-username", (Function *)bash_complete_username, -1); ! rl_bind_key_in_map ('~', (Function *)bash_complete_username, emacs_meta_keymap); rl_add_defun ("possible-username-completions", ! (Function *)bash_possible_username_completions, -1); ! rl_bind_key_in_map ('~', (Function *)bash_possible_username_completions, emacs_ctlx_keymap); ! rl_add_defun ("complete-hostname", (Function *)bash_complete_hostname, -1); ! rl_bind_key_in_map ('@', (Function *)bash_complete_hostname, emacs_meta_keymap); rl_add_defun ("possible-hostname-completions", ! (Function *)bash_possible_hostname_completions, -1); ! rl_bind_key_in_map ('@', (Function *)bash_possible_hostname_completions, emacs_ctlx_keymap); ! rl_add_defun ("complete-variable", (Function *)bash_complete_variable, -1); ! rl_bind_key_in_map ('$', (Function *)bash_complete_variable, emacs_meta_keymap); rl_add_defun ("possible-variable-completions", ! (Function *)bash_possible_variable_completions, -1); ! rl_bind_key_in_map ('$', (Function *)bash_possible_variable_completions, emacs_ctlx_keymap); ! rl_add_defun ("complete-command", (Function *)bash_complete_command, -1); ! rl_bind_key_in_map ('!', (Function *)bash_complete_command, emacs_meta_keymap); rl_add_defun ("possible-command-completions", ! (Function *)bash_possible_command_completions, -1); ! rl_bind_key_in_map ('!', (Function *)bash_possible_command_completions, emacs_ctlx_keymap); ! rl_add_defun ("glob-expand-word", (Function *)bash_glob_expand_word, -1); ! rl_add_defun ("glob-list-expansions", (Function *)bash_glob_list_expansions, -1); ! rl_bind_key_in_map ('*', (Function *)bash_glob_expand_word, emacs_ctlx_keymap); ! rl_bind_key_in_map ('g', (Function *)bash_glob_list_expansions, emacs_ctlx_keymap); #endif /* SPECIFIC_COMPLETION_FUNCTIONS */ ! rl_add_defun ("dynamic-complete-history", (Function *)dynamic_complete_history, -1); ! rl_bind_key_in_map (TAB, (Function *)dynamic_complete_history, emacs_meta_keymap); /* Tell the completer that we want a crack first. */ *************** *** 296,302 **** #if defined (VI_MODE) ! rl_bind_key_in_map ('v', vi_edit_and_execute_command, vi_movement_keymap); # if defined (ALIAS) ! rl_bind_key_in_map ('@', posix_edit_macros, vi_movement_keymap); # endif #endif --- 296,302 ---- #if defined (VI_MODE) ! rl_bind_key_in_map ('v', (Function *)vi_edit_and_execute_command, vi_movement_keymap); # if defined (ALIAS) ! rl_bind_key_in_map ('@', (Function *)posix_edit_macros, vi_movement_keymap); # endif #endif *************** *** 562,566 **** { if (saved_history_line_to_use >= 0) ! rl_get_previous_history (history_length - saved_history_line_to_use); saved_history_line_to_use = -1; rl_startup_hook = old_rl_startup_hook; --- 562,566 ---- { if (saved_history_line_to_use >= 0) ! rl_get_previous_history (history_length - saved_history_line_to_use, 0); saved_history_line_to_use = -1; rl_startup_hook = old_rl_startup_hook; *************** *** 574,578 **** /* Accept the current line. */ ! rl_newline (); /* Find the current line, and find the next line to use. */ --- 574,578 ---- /* Accept the current line. */ ! rl_newline (1, c); /* Find the current line, and find the next line to use. */ *************** *** 603,607 **** /* Accept the current line. */ ! rl_newline (); if (rl_explicit_arg) --- 603,607 ---- /* Accept the current line. */ ! rl_newline (1, c); if (rl_explicit_arg) *************** *** 1259,1263 **** rl_point = old_point; if (!whitespace (rl_line_buffer[rl_point])) ! rl_forward_word (1); } } --- 1259,1263 ---- rl_point = old_point; if (!whitespace (rl_line_buffer[rl_point])) ! rl_forward_word (1, 0); } } *************** *** 1420,1424 **** rl_point = old_point; if (!whitespace (rl_line_buffer[rl_point])) ! rl_forward_word (1); } } --- 1420,1424 ---- rl_point = old_point; if (!whitespace (rl_line_buffer[rl_point])) ! rl_forward_word (1, 0); } } *************** *** 1554,1561 **** --- 1554,1575 ---- } + #if 0 + static int + ignore_dot_names (name) + char *name; + { + return (name[0] != '.'); + } + #endif + static void filename_completion_ignore (names) char **names; { + #if 0 + if (glob_dot_filenames == 0) + _ignore_completion_names (names, ignore_dot_names); + #endif + setup_ignore_patterns (&fignore); *************** *** 1598,1609 **** char **dirname; { ! char *local_dirname, *t; int return_value = 0; WORD_LIST *wl; local_dirname = *dirname; if (strchr (local_dirname, '$') || strchr (local_dirname, '`')) { ! wl = expand_string (local_dirname, 0); if (wl) { --- 1612,1624 ---- char **dirname; { ! char *local_dirname, *new_dirname, *t; int return_value = 0; WORD_LIST *wl; local_dirname = *dirname; + new_dirname = savestring (local_dirname); if (strchr (local_dirname, '$') || strchr (local_dirname, '`')) { ! wl = expand_string (new_dirname, 0); if (wl) { *************** *** 1613,1616 **** --- 1628,1632 ---- return_value = STREQ (local_dirname, *dirname) == 0; free (local_dirname); + free (new_dirname); dispose_words (wl); local_dirname = *dirname; *************** *** 1618,1621 **** --- 1634,1638 ---- else { + free (new_dirname); free (local_dirname); *dirname = xmalloc (1); diff -aNrc2 bash-2.02.1/builtins/Makefile.in bash-2.03/builtins/Makefile.in *** bash-2.02.1/builtins/Makefile.in Wed Oct 15 11:28:57 1997 --- bash-2.03/builtins/Makefile.in Thu Feb 18 12:08:08 1999 *************** *** 1,9 **** # This Makefile for building libbuiltins.a is in -*- text -*- for Emacs. # ! SHELL = /bin/sh RANLIB = @RANLIB@ CC = @CC@ CC_FOR_BUILD = @CC_FOR_BUILD@ AR = @AR@ RM = rm -f CP = cp --- 1,10 ---- # This Makefile for building libbuiltins.a is in -*- text -*- for Emacs. # ! SHELL = @MAKE_SHELL@ RANLIB = @RANLIB@ CC = @CC@ CC_FOR_BUILD = @CC_FOR_BUILD@ AR = @AR@ + ARFLAGS = @ARFLAGS@ RM = rm -f CP = cp *************** *** 25,29 **** LIBS = @LIBS@ ! INCLUDES = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(srcdir) CCFLAGS = ${PROFILE_FLAGS} $(DEFS) $(LOCAL_DEFS) $(SYSTEM_FLAGS) $(CPPFLAGS) \ --- 26,30 ---- LIBS = @LIBS@ ! INCLUDES = -I. -I.. @RL_INCLUDE@ -I$(topdir) -I$(topdir)/lib -I$(srcdir) CCFLAGS = ${PROFILE_FLAGS} $(DEFS) $(LOCAL_DEFS) $(SYSTEM_FLAGS) $(CPPFLAGS) \ *************** *** 88,92 **** libbuiltins.a: $(MKBUILTINS) $(OFILES) builtins.o $(RM) $@ ! $(AR) cr $@ $(OFILES) -$(RANLIB) $@ --- 89,93 ---- libbuiltins.a: $(MKBUILTINS) $(OFILES) builtins.o $(RM) $@ ! $(AR) $(ARFLAGS) $@ $(OFILES) -$(RANLIB) $@ *************** *** 96,105 **** ./$(MKBUILTINS) -externfile builtext.h -structfile builtins.c \ -noproduction $(DIRECTDEFINE) $(DEFSRC) ! @-if cmp -s old-builtext.h builtext.h; then \ mv old-builtext.h builtext.h; \ else \ $(RM) old-builtext.h; \ fi ! @-if cmp -s old-builtins.c builtins.c; then \ mv old-builtins.c builtins.c; \ else \ --- 97,106 ---- ./$(MKBUILTINS) -externfile builtext.h -structfile builtins.c \ -noproduction $(DIRECTDEFINE) $(DEFSRC) ! @-if cmp -s old-builtext.h builtext.h 2>/dev/null; then \ mv old-builtext.h builtext.h; \ else \ $(RM) old-builtext.h; \ fi ! @-if cmp -s old-builtins.c builtins.c 2>/dev/null; then \ mv old-builtins.c builtins.c; \ else \ *************** *** 113,117 **** mkbuiltins: mkbuiltins.o ! $(CC_FOR_BUILD) $(LDFLAGS) -o $(MKBUILTINS) mkbuiltins.o $(LIBS) # rules for deficient makes, like SunOS --- 114,118 ---- mkbuiltins: mkbuiltins.o ! $(CC_FOR_BUILD) $(PROFILE_FLAGS) $(LDFLAGS) -o $(MKBUILTINS) mkbuiltins.o $(LIBS) # rules for deficient makes, like SunOS *************** *** 127,131 **** pipesize.h: psize.aux ! $(SHELL) $(srcdir)/psize.sh > pipesize.h psize.aux: psize.c --- 128,132 ---- pipesize.h: psize.aux ! $(SHELL) $(srcdir)/psize.sh > $@ psize.aux: psize.c *************** *** 140,144 **** clean: ! $(RM) $(OFILES) $(CREATED_FILES) $(MKBUILTINS) libbuiltins.a mostlyclean: --- 141,145 ---- clean: ! $(RM) $(OFILES) $(CREATED_FILES) $(MKBUILTINS) mkbuiltins.o libbuiltins.a mostlyclean: diff -aNrc2 bash-2.02.1/builtins/cd.def bash-2.03/builtins/cd.def *** bash-2.02.1/builtins/cd.def Tue Jun 30 12:09:35 1998 --- bash-2.03/builtins/cd.def Wed Jun 3 13:19:21 1998 *************** *** 141,160 **** dirname = get_working_directory ("cd"); - bind_variable ("OLDPWD", get_string_value ("PWD")); - old_anm = array_needs_making; tvar = bind_variable ("PWD", dirname); - /* This is an efficiency hack. If PWD is exported, we will need to - remake the exported environment every time we change directories. - If there is no other reason to make the exported environment, just - update PWD in place and mark the exported environment as no longer - needing a remake. */ if (old_anm == 0 && array_needs_making && exported_p (tvar)) { ! pwdvar = xmalloc (STRLEN (dirname) + 5); /* 5 = "PWD" + '=' + '\0' */ ! strcpy (pwdvar, "PWD="); ! if (dirname) ! strcpy (pwdvar + 4, dirname); ! add_or_supercede_exported_var (pwdvar, 0); array_needs_making = 0; } --- 141,158 ---- dirname = get_working_directory ("cd"); old_anm = array_needs_making; + pwdvar = get_string_value ("PWD"); + + tvar = bind_variable ("OLDPWD", pwdvar); + if (old_anm == 0 && array_needs_making && exported_p (tvar)) + { + update_export_env_inplace ("OLDPWD=", 7, pwdvar); + array_needs_making = 0; + } + tvar = bind_variable ("PWD", dirname); if (old_anm == 0 && array_needs_making && exported_p (tvar)) { ! update_export_env_inplace ("PWD=", 4, dirname); array_needs_making = 0; } *************** *** 244,248 **** /* Find directory in $CDPATH. */ path_index = 0; ! while ((path = extract_colon_unit (cdpath, &path_index))) { /* OPT is 1 if the path element is non-empty */ --- 242,246 ---- /* Find directory in $CDPATH. */ path_index = 0; ! while (path = extract_colon_unit (cdpath, &path_index)) { /* OPT is 1 if the path element is non-empty */ diff -aNrc2 bash-2.02.1/builtins/enable.def bash-2.03/builtins/enable.def *** bash-2.02.1/builtins/enable.def Fri Jul 18 16:55:00 1997 --- bash-2.03/builtins/enable.def Wed Dec 16 11:45:56 1998 *************** *** 27,41 **** Enable and disable builtin shell commands. This allows you to use a disk command which has the same name as a shell ! builtin. If -n is used, the NAMEs become disabled; otherwise ! NAMEs are enabled. For example, to use the `test' found on your ! path instead of the shell builtin version, type `enable -n test'. ! On systems supporting dynamic loading, the -f option may be used ! to load new builtins from the shared object FILENAME. The -d ! option will delete a builtin previously loaded with -f. If no ! non-option names are given, or the -p option is supplied, a list ! of builtins is printed. The -a option means to print every builtin ! with an indication of whether or not it is enabled. The -s option ! restricts the output to the Posix.2 `special' builtins. The -n ! option displays a list of all disabled builtins. $END --- 27,41 ---- Enable and disable builtin shell commands. This allows you to use a disk command which has the same name as a shell ! builtin without specifying a full pathname. If -n is used, the ! NAMEs become disabled; otherwise NAMEs are enabled. For example, ! to use the `test' found in $PATH instead of the shell builtin ! version, type `enable -n test'. On systems supporting dynamic ! loading, the -f option may be used to load new builtins from the ! shared object FILENAME. The -d option will delete a builtin ! previously loaded with -f. If no non-option names are given, or ! the -p option is supplied, a list of builtins is printed. The ! -a option means to print every builtin with an indication of whether ! or not it is enabled. The -s option restricts the output to the POSIX.2 ! `special' builtins. The -n option displays a list of all disabled builtins. $END *************** *** 392,395 **** --- 392,409 ---- } + /* Tenon's MachTen has a dlclose that doesn't return a value, so we + finesse it with a local wrapper. */ + static int + local_dlclose (handle) + void *handle; + { + #if !defined (__MACHTEN__) + return (dlclose (handle)); + #else /* __MACHTEN__ */ + dlclose (handle); + return ((dlerror () != NULL) ? -1 : 0); + #endif /* __MACHTEN__ */ + } + static int dyn_unload_builtin (name) *************** *** 399,402 **** --- 413,417 ---- void *handle; int ref, i; + char *uerror; b = builtin_address_internal (name, 1); *************** *** 421,425 **** /* Don't remove the shared object unless the reference count of builtins using it drops to zero. */ ! if (ref == 1 && dlclose (handle) != 0) { builtin_error ("cannot delete %s: %s", name, dlerror ()); --- 436,440 ---- /* Don't remove the shared object unless the reference count of builtins using it drops to zero. */ ! if (ref == 1 && local_dlclose (handle) != 0) { builtin_error ("cannot delete %s: %s", name, dlerror ()); diff -aNrc2 bash-2.02.1/builtins/evalstring.c bash-2.03/builtins/evalstring.c *** bash-2.02.1/builtins/evalstring.c Mon Sep 22 12:39:24 1997 --- bash-2.03/builtins/evalstring.c Tue Jan 12 12:50:14 1999 *************** *** 52,55 **** --- 52,57 ---- #endif + #define IS_BUILTIN(s) (builtin_address_internal(s, 0) != (struct builtin *)NULL) + extern void run_trap_cleanup (); *************** *** 182,186 **** default: ! programming_error ("parse_and_execute: bad jump: code %d", code); break; } --- 184,188 ---- default: ! command_error ("parse_and_execute", CMDERR_BADJUMP, code, 0); break; } *************** *** 207,213 **** #if defined (ONESHOT) ! if (startup_state == 2 && *bash_input.location.string == '\0' && ! command->type == cm_simple && !command->redirects && ! !command->value.Simple->redirects && ((command->flags & CMD_TIME_PIPELINE) == 0)) { --- 209,226 ---- #if defined (ONESHOT) ! /* ! * IF ! * we were invoked as `bash -c' (startup_state == 2) AND ! * parse_and_execute has not been called recursively AND ! * we have parsed the full command (string == '\0') AND ! * we have a simple command without redirections AND ! * the command is not being timed ! * THEN ! * tell the execution code that we don't need to fork ! */ ! if (startup_state == 2 && parse_and_execute_level == 1 && ! *bash_input.location.string == '\0' && ! command->type == cm_simple && ! !command->redirects && !command->value.Simple->redirects && ((command->flags & CMD_TIME_PIPELINE) == 0)) { diff -aNrc2 bash-2.02.1/builtins/fc.def bash-2.03/builtins/fc.def *** bash-2.02.1/builtins/fc.def Thu Jul 17 09:42:44 1997 --- bash-2.03/builtins/fc.def Wed Feb 17 14:46:30 1999 *************** *** 27,30 **** --- 27,31 ---- $SHORT_DOC fc [-e ename] [-nlr] [first] [last] or fc -s [pat=rep] [cmd] + fc is used to list or edit and re-execute commands from the history list. FIRST and LAST can be numbers specifying the range, or FIRST can be a string, which means the most recent command beginning with that *************** *** 32,37 **** -e ENAME selects which editor to use. Default is FCEDIT, then EDITOR, ! then the editor which corresponds to the current readline editing ! mode, then vi. -l means list lines instead of editing. --- 33,37 ---- -e ENAME selects which editor to use. Default is FCEDIT, then EDITOR, ! then vi. -l means list lines instead of editing. *************** *** 157,161 **** register char *sep; int numbering, reverse, listing, execute; ! int histbeg, histend, last_hist, retval, first, opt; FILE *stream; REPL *rlist, *rl; --- 157,161 ---- register char *sep; int numbering, reverse, listing, execute; ! int histbeg, histend, last_hist, retval, opt; FILE *stream; REPL *rlist, *rl; *************** *** 373,391 **** } - /* Now reopen the file and execute the edited commands. */ - - stream = fopen (fn, "r"); - - if (stream == NULL) - { - builtin_error ("cannot reopen temp file %s", fn); - unlink (fn); - return (EXECUTION_FAILURE); - } - - retval = EXECUTION_SUCCESS; - first = 1; - - #if 1 /* Make sure parse_and_execute doesn't turn this off, even though a call to parse_and_execute farther up the function call stack (e.g., --- 373,376 ---- *************** *** 393,434 **** called bash_history_disable. */ remember_on_history = 1; - #else - /* First, write the commands to the history file. This will not happen - when we call parse_and_execute, since parse_and_execute disables - the command line history while it executes. */ - - opt = current_command_line_count; - while ((line = fc_readline (stream)) != NULL) - { - if (line[0] == '\n') - { - free (line); - continue; /* Skip blank lines. */ - } - - if (first) - { - first = 0; - /* If we retrieved only one command from the history file, but we - read multiple lines from the edited file, and literal_history - has been set by `shopt', we assume that it was a compound - command stored with embedded newlines. In this case, we want - the history code to store it as one command again. */ - if (literal_history && histbeg == histend) - current_command_line_count = 1; - fc_replhist (line); - } - else - { - if (literal_history && histbeg == histend) - current_command_line_count++; - fc_addhist (line); - } - - free (line); - } - fclose (stream); - current_command_line_count = opt; - #endif /* Turn on the `v' flag while fc_execute_file runs so the commands --- 378,381 ---- diff -aNrc2 bash-2.02.1/builtins/getopt.c bash-2.03/builtins/getopt.c *** bash-2.02.1/builtins/getopt.c Fri Jul 18 16:56:06 1997 --- bash-2.03/builtins/getopt.c Wed Jan 13 16:12:47 1999 *************** *** 233,236 **** --- 233,249 ---- } + #if 0 + void + sh_getopt_debug_restore_state (argv) + char **argv; + { + if (nextchar && nextchar != argv[sh_curopt] + sh_charindex) + { + itrace("sh_getopt_debug_restore_state: resetting nextchar"); + nextchar = argv[sh_curopt] + sh_charindex; + } + } + #endif + #ifdef TEST diff -aNrc2 bash-2.02.1/builtins/getopts.def bash-2.03/builtins/getopts.def *** bash-2.02.1/builtins/getopts.def Fri Jul 18 16:56:17 1997 --- bash-2.03/builtins/getopts.def Wed Jan 13 16:13:16 1999 *************** *** 182,185 **** --- 182,187 ---- for (i = 0; i < 10 && dollar_vars[i]; i++) ; + + sh_getopt_restore_state (dollar_vars); ret = sh_getopt (i, dollar_vars, optstr); } *************** *** 199,202 **** --- 201,205 ---- v[i] = words->word->word; v[i] = (char *)NULL; + sh_getopt_restore_state (v); ret = sh_getopt (i, v, optstr); free (v); diff -aNrc2 bash-2.02.1/builtins/mkbuiltins.c bash-2.03/builtins/mkbuiltins.c *** bash-2.02.1/builtins/mkbuiltins.c Mon Oct 13 14:00:49 1997 --- bash-2.03/builtins/mkbuiltins.c Tue Sep 15 12:57:16 1998 *************** *** 131,134 **** --- 131,138 ---- static int is_assignment_builtin (); + #if !defined (HAVE_RENAME) + static int rename (); + #endif + void extract_info (); *************** *** 266,271 **** write_longdocs (structfile, saved_builtins); fclose (structfile); ! link (temp_struct_filename, struct_filename); ! unlink (temp_struct_filename); } --- 270,274 ---- write_longdocs (structfile, saved_builtins); fclose (structfile); ! rename (temp_struct_filename, struct_filename); } *************** *** 458,461 **** --- 461,468 ---- file_error (filename); + /* This is needed on WIN32, and does not hurt on Unix. */ + if (nr < file_size) + file_size = nr; + close (fd); *************** *** 1396,1397 **** --- 1403,1417 ---- return (_find_in_table (name, assignment_builtins)); } + + #if !defined (HAVE_RENAME) + static int + rename (from, to) + char *from, *to; + { + unlink (to); + if (link (from, to) < 0) + return (-1); + unlink (from); + return (0); + } + #endif /* !HAVE_RENAME */ diff -aNrc2 bash-2.02.1/builtins/printf.def bash-2.03/builtins/printf.def *** bash-2.02.1/builtins/printf.def Tue Jun 30 12:09:41 1998 --- bash-2.03/builtins/printf.def Tue Sep 15 17:11:57 1998 *************** *** 100,104 **** WORD_LIST *list; { ! int ch, end, fieldwidth, precision, foundmod; char convch, nextch, *format, *fmt, *start; --- 100,104 ---- WORD_LIST *list; { ! int ch, end, fieldwidth, precision, foundmod, fmtlen; char convch, nextch, *format, *fmt, *start; *************** *** 126,135 **** return (EXECUTION_SUCCESS); ! format = ansicstr (list->word->word, strlen (list->word->word), (int *)NULL, (int *)NULL); garglist = list->next; /* If the format string is empty after preprocessing, return immediately. */ ! if (format == 0 || *format == 0) return (EXECUTION_SUCCESS); --- 126,135 ---- return (EXECUTION_SUCCESS); ! format = ansicstr (list->word->word, strlen (list->word->word), (int *)NULL, &fmtlen); garglist = list->next; /* If the format string is empty after preprocessing, return immediately. */ ! if ((format == 0 || *format == 0) && fmtlen == 0) return (EXECUTION_SUCCESS); *************** *** 140,148 **** arguments, arguments of zero/null string are provided to use up the format string. */ do { /* find next format specification */ ! for (fmt = format; *fmt; fmt++) { precision = fieldwidth = foundmod = 0; --- 140,149 ---- arguments, arguments of zero/null string are provided to use up the format string. */ + #define FMTIND (fmt - format) do { /* find next format specification */ ! for (fmt = format; FMTIND < fmtlen; fmt++) { precision = fieldwidth = foundmod = 0; *************** *** 180,188 **** for (; *fmt && strchr(SKIP2, *fmt); ++fmt) ; - if (*fmt == 0) - { - builtin_error ("`%s': missing format character", start); - PRETURN (EXECUTION_FAILURE); - } /* skip possible format modifiers */ --- 181,184 ---- *************** *** 193,196 **** --- 189,198 ---- } + if (*fmt == 0) + { + builtin_error ("`%s': missing format character", start); + PRETURN (EXECUTION_FAILURE); + } + convch = *fmt; nextch = fmt[1]; diff -aNrc2 bash-2.02.1/builtins/pushd.def bash-2.03/builtins/pushd.def *** bash-2.02.1/builtins/pushd.def Fri Nov 14 12:32:52 1997 --- bash-2.03/builtins/pushd.def Mon May 11 12:21:31 1998 *************** *** 118,121 **** --- 118,125 ---- #include "builtext.h" + #ifdef LOADABLE_BUILTIN + # include "builtins.h" + #endif + #if !defined (errno) extern int errno; *************** *** 643,645 **** --- 647,743 ---- return ret; /* was (REVERSE_LIST (ret, (WORD_LIST *)); */ } + + #ifdef LOADABLE_BUILTIN + static char *dirs_doc[] = { + "Display the list of currently remembered directories. Directories", + "find their way onto the list with the `pushd' command; you can get", + "back up through the list with the `popd' command.", + "", + "The -l flag specifies that `dirs' should not print shorthand versions", + "of directories which are relative to your home directory. This means", + "that `~/bin' might be displayed as `/homes/bfox/bin'. The -v flag", + "causes `dirs' to print the directory stack with one entry per line,", + "prepending the directory name with its position in the stack. The -p", + "flag does the same thing, but the stack position is not prepended.", + "The -c flag clears the directory stack by deleting all of the elements.", + "", + "+N displays the Nth entry counting from the left of the list shown by", + " dirs when invoked without options, starting with zero.", + "", + "-N displays the Nth entry counting from the right of the list shown by", + " dirs when invoked without options, starting with zero.", + (char *)NULL + }; + + static char *pushd_doc[] = { + "Adds a directory to the top of the directory stack, or rotates", + "the stack, making the new top of the stack the current working", + "directory. With no arguments, exchanges the top two directories.", + "", + "+N Rotates the stack so that the Nth directory (counting", + " from the left of the list shown by `dirs', starting with", + " zero) is at the top.", + "", + "-N Rotates the stack so that the Nth directory (counting", + " from the right of the list shown by `dirs', starting with", + " zero) is at the top.", + "", + "-n suppress the normal change of directory when adding directories", + " to the stack, so only the stack is manipulated.", + "", + "dir adds DIR to the directory stack at the top, making it the", + " new current working directory.", + "", + "You can see the directory stack with the `dirs' command.", + (char *)NULL + }; + + static char *popd_doc[] = { + "Removes entries from the directory stack. With no arguments,", + "removes the top directory from the stack, and cd's to the new", + "top directory.", + "", + "+N removes the Nth entry counting from the left of the list", + " shown by `dirs', starting with zero. For example: `popd +0'", + " removes the first directory, `popd +1' the second.", + "", + "-N removes the Nth entry counting from the right of the list", + " shown by `dirs', starting with zero. For example: `popd -0'", + " removes the last directory, `popd -1' the next to last.", + "", + "-n suppress the normal change of directory when removing directories", + " from the stack, so only the stack is manipulated.", + "", + "You can see the directory stack with the `dirs' command.", + (char *)NULL + }; + + struct builtin pushd_struct = { + "pushd", + pushd_builtin, + BUILTIN_ENABLED, + pushd_doc, + "pushd [+N | -N] [-n] [dir]", + 0 + }; + + struct builtin popd_struct = { + "popd", + popd_builtin, + BUILTIN_ENABLED, + popd_doc, + "popd [+N | -N] [-n]", + 0 + }; + + struct builtin dirs_struct = { + "dirs", + dirs_builtin, + BUILTIN_ENABLED, + dirs_doc, + "dirs [-clpv] [+N] [-N]", + 0 + }; + #endif /* LOADABLE_BUILTIN */ + #endif /* PUSHD_AND_POPD */ diff -aNrc2 bash-2.02.1/builtins/read.def bash-2.03/builtins/read.def *** bash-2.02.1/builtins/read.def Mon Nov 17 14:31:28 1997 --- bash-2.03/builtins/read.def Fri Feb 5 15:34:32 1999 *************** *** 190,193 **** --- 190,194 ---- } else + { #endif *************** *** 199,202 **** --- 200,207 ---- break; } + + #if defined (READLINE) + } + #endif if (i + 2 >= size) diff -aNrc2 bash-2.02.1/builtins/reserved.def bash-2.03/builtins/reserved.def *** bash-2.02.1/builtins/reserved.def Tue Jul 30 16:47:00 1996 --- bash-2.03/builtins/reserved.def Wed Oct 21 11:35:03 1998 *************** *** 90,94 **** $BUILTIN { ... } $DOCNAME grouping_braces ! $SHORT_DOC { COMMANDS } Run a set of commands in a group. This is one way to redirect an entire set of commands. --- 90,94 ---- $BUILTIN { ... } $DOCNAME grouping_braces ! $SHORT_DOC { COMMANDS ; } Run a set of commands in a group. This is one way to redirect an entire set of commands. diff -aNrc2 bash-2.02.1/builtins/set.def bash-2.03/builtins/set.def *** bash-2.02.1/builtins/set.def Thu Dec 4 09:28:24 1997 --- bash-2.03/builtins/set.def Thu Jul 23 10:40:00 1998 *************** *** 93,97 **** noexec same as -n noglob same as -f ! notify save as -b nounset same as -u onecmd same as -t --- 93,97 ---- noexec same as -n noglob same as -f ! notify same as -b nounset same as -u onecmd same as -t diff -aNrc2 bash-2.02.1/builtins/shopt.def bash-2.03/builtins/shopt.def *** bash-2.02.1/builtins/shopt.def Fri Sep 19 11:30:38 1997 --- bash-2.03/builtins/shopt.def Tue Nov 10 12:56:03 1998 *************** *** 80,87 **** --- 80,96 ---- #endif + #if defined (RESTRICTED_SHELL) + extern int restricted_shell; + extern char *shell_name; + #endif + extern void set_shellopts (); static int set_interactive_comments (); + #if defined (RESTRICTED_SHELL) + static int set_restricted_shell (); + #endif + static struct { char *name; *************** *** 121,124 **** --- 130,136 ---- { "nullglob", &allow_null_glob_expansion, (Function *)NULL }, { "promptvars", &promptvars, (Function *)NULL }, + #if defined (RESTRICTED_SHELL) + { "restricted_shell", &restricted_shell, set_restricted_shell }, + #endif { "shift_verbose", &print_shift_error, (Function *)NULL }, { "sourcepath", &source_uses_path, (Function *)NULL }, *************** *** 263,267 **** } ! static int print_shopt (name, val, flags) char *name; --- 275,279 ---- } ! static void print_shopt (name, val, flags) char *name; *************** *** 401,402 **** --- 413,431 ---- return (0); } + + #if defined (RESTRICTED_SHELL) + /* Don't allow the value of restricted_shell to be modified. */ + + static int + set_restricted_shell (mode) + int mode; + { + static int save_restricted = -1; + + if (save_restricted == -1) + save_restricted = shell_is_restricted (shell_name); + + restricted_shell = save_restricted; + return (0); + } + #endif /* RESTRICTED_SHELL */ diff -aNrc2 bash-2.02.1/builtins/test.def bash-2.03/builtins/test.def *** bash-2.02.1/builtins/test.def Thu Sep 11 09:28:37 1997 --- bash-2.03/builtins/test.def Thu Nov 12 13:58:43 1998 *************** *** 130,134 **** { if (this_command_name[0] == '[' && !this_command_name[1]) ! builtin_error ("missing `]'"); return (EXECUTION_FAILURE); --- 130,137 ---- { if (this_command_name[0] == '[' && !this_command_name[1]) ! { ! builtin_error ("missing `]'"); ! return (EX_BADUSAGE); ! } return (EXECUTION_FAILURE); diff -aNrc2 bash-2.02.1/builtins/type.def bash-2.03/builtins/type.def *** bash-2.02.1/builtins/type.def Thu Jul 10 11:55:57 1997 --- bash-2.03/builtins/type.def Wed May 13 15:51:11 1998 *************** *** 63,66 **** --- 63,67 ---- #include "common.h" + #include "bashgetopt.h" extern int find_reserved_word (); *************** *** 70,81 **** execve, or if it is a builtin command, or an alias. Possible flag arguments: ! -type Returns the "type" of the object, one of `alias', `keyword', `function', `builtin', or `file'. ! -path Returns the pathname of the file if -type is a file. ! -all Returns all occurrences of words, whether they be a filename in the path, alias, function, or builtin. --- 71,82 ---- execve, or if it is a builtin command, or an alias. Possible flag arguments: ! -t Returns the "type" of the object, one of `alias', `keyword', `function', `builtin', or `file'. ! -p Returns the pathname of the file if -type is a file. ! -a Returns all occurrences of words, whether they be a filename in the path, alias, function, or builtin. *************** *** 87,90 **** --- 88,92 ---- file */ + int type_builtin (list) *************** *** 92,96 **** { int path_only, type_only, all, verbose; ! int successful_finds; if (list == 0) --- 94,99 ---- { int path_only, type_only, all, verbose; ! int successful_finds, opt; ! WORD_LIST *prev, *this; if (list == 0) *************** *** 100,129 **** successful_finds = 0; ! while (list && *(list->word->word) == '-') { ! char *flag = &(list->word->word[1]); ! if (flag[0] == 't' && (!flag[1] || strcmp (flag + 1, "ype") == 0)) { type_only = 1; path_only = 0; } ! else if (flag[0] == 'p' && (!flag[1] || strcmp (flag + 1, "ath") == 0)) { path_only = 1; type_only = 0; } ! else if (flag[0] == 'a' && (!flag[1] || strcmp (flag + 1, "ll") == 0)) { ! all = 1; } else { ! bad_option (flag); builtin_usage (); return (EX_USAGE); } - list = list->next; } if (type_only) --- 103,169 ---- successful_finds = 0; ! /* Handle the obsolescent `-type', `-path', and `-all' by prescanning ! the arguments and removing those options from the list before calling ! internal_getopt. Recognize `--type', `--path', and `--all' also. ! THIS SHOULD REALLY GO AWAY. */ ! for (this = list; this && this->word->word[0] == '-'; ) { ! char *flag = &(this->word->word[1]); ! if (STREQ (flag, "type") || STREQ (flag, "-type")) { type_only = 1; path_only = 0; } ! else if (STREQ (flag, "path") || STREQ (flag, "-path")) { path_only = 1; type_only = 0; } ! else if (STREQ (flag, "all") || STREQ (flag, "-all")) ! all = 1; ! else { ! prev = this; ! this = this->next; ! continue; } + + /* We found a long option; remove it from the argument list. Don't + free it if it's the head of the argument list, though -- the + argument list will be freed by the caller. */ + if (this == list) + this = list = list->next; else { ! prev->next = this->next; ! this->next = (WORD_LIST *)NULL; ! dispose_words (this); ! this = prev->next; ! } ! } ! ! reset_internal_getopt (); ! while ((opt = internal_getopt (list, "apt")) != -1) ! { ! switch (opt) ! { ! case 't': ! type_only = 1; ! path_only = 0; ! break; ! case 'p': ! path_only = 1; ! type_only = 0; ! break; ! case 'a': ! all = 1; ! break; ! default: builtin_usage (); return (EX_USAGE); } } + list = loptend; if (type_only) *************** *** 151,158 **** fflush (stdout); ! if (successful_finds != 0) ! return (EXECUTION_SUCCESS); ! else ! return (EXECUTION_FAILURE); } --- 191,195 ---- fflush (stdout); ! return ((successful_finds != 0) ? EXECUTION_SUCCESS : EXECUTION_FAILURE); } *************** *** 203,207 **** found = 1; ! if (!all) return (1); } --- 240,244 ---- found = 1; ! if (all == 0) return (1); } *************** *** 221,225 **** found = 1; ! if (!all) return (1); } --- 258,262 ---- found = 1; ! if (all == 0) return (1); } *************** *** 252,256 **** found = 1; ! if (!all) return (1); } --- 289,293 ---- found = 1; ! if (all == 0) return (1); } *************** *** 268,272 **** found = 1; ! if (!all) return (1); } --- 305,309 ---- found = 1; ! if (all == 0) return (1); } *************** *** 294,300 **** } ! /* If the user isn't doing "-all", then we might care about whether the file is present in our hash table. */ ! if (!all) { if ((full_path = find_hashed_filename (command)) != (char *)NULL) --- 331,337 ---- } ! /* If the user isn't doing "-a", then we might care about whether the file is present in our hash table. */ ! if (all == 0) { if ((full_path = find_hashed_filename (command)) != (char *)NULL) *************** *** 315,319 **** while (1) { ! if (!all) full_path = find_user_command (command); else --- 352,356 ---- while (1) { ! if (all == 0) full_path = find_user_command (command); else *************** *** 338,342 **** full_path = (char *)NULL; ! if (!all) break; } --- 375,379 ---- full_path = (char *)NULL; ! if (all == 0) break; } diff -aNrc2 bash-2.02.1/builtins/ulimit.def bash-2.03/builtins/ulimit.def *** bash-2.02.1/builtins/ulimit.def Thu Oct 9 13:19:19 1997 --- bash-2.03/builtins/ulimit.def Thu Jan 7 14:10:16 1999 *************** *** 155,176 **** #endif - #if !defined (RLIM_INVALID) - # define RLIM_INVALID (RLIMTYPE)-1 - #endif - #define LIMIT_HARD 0x01 #define LIMIT_SOFT 0x02 ! static int ulimit_internal (); ! static void printone (); ! static void print_all_limits (); ! ! static int get_limit (); ! static int set_limit (); ! ! static RLIMTYPE filesize (); ! static RLIMTYPE pipesize (); ! static RLIMTYPE getmaxuprc (); ! static RLIMTYPE getmaxvm (); typedef struct { --- 155,172 ---- #endif #define LIMIT_HARD 0x01 #define LIMIT_SOFT 0x02 ! static int ulimit_internal __P((int, char *, int, int)); ! static void printone __P((int, RLIMTYPE, int)); ! static void print_all_limits __P((int)); ! ! static int get_limit __P((int, int, RLIMTYPE *)); ! static int set_limit __P((int, RLIMTYPE, int)); ! ! static int filesize __P((RLIMTYPE *)); ! static int pipesize __P((RLIMTYPE *)); ! static int getmaxuprc __P((int, RLIMTYPE *)); ! static int getmaxvm __P((int, RLIMTYPE *)); typedef struct { *************** *** 352,356 **** RLIMTYPE current_limit, real_limit, limit; - limit = RLIM_INVALID; setting = cmdarg != 0; limind = _findlim (cmd); --- 348,351 ---- *************** *** 413,420 **** { case RLIMIT_FILESIZE: ! value = filesize (); break; case RLIMIT_PIPESIZE: ! value = pipesize (); break; case RLIMIT_OPENFILES: --- 408,417 ---- { case RLIMIT_FILESIZE: ! if (filesize (&value) < 0) ! return -1; break; case RLIMIT_PIPESIZE: ! if (pipesize (&value) < 0) ! return -1; break; case RLIMIT_OPENFILES: *************** *** 422,429 **** break; case RLIMIT_VIRTMEM: ! value = getmaxvm (mode); break; case RLIMIT_MAXUPROC: ! value = getmaxuprc (mode); break; default: --- 419,428 ---- break; case RLIMIT_VIRTMEM: ! if (getmaxvm (mode, &value) < 0) ! return -1; break; case RLIMIT_MAXUPROC: ! if (getmaxuprc (mode, &value) < 0) ! return -1; break; default: *************** *** 432,436 **** } *limptr = value; ! return ((value == RLIM_INVALID) ? -1 : 0); } else --- 431,435 ---- } *limptr = value; ! return (0); } else *************** *** 440,443 **** --- 439,447 ---- return -1; value = (mode & LIMIT_SOFT) ? limit.rlim_cur : limit.rlim_max; + # if defined (HPUX9) + if (limits[ind].parameter == RLIMIT_FILESIZE) + *limptr = value * 512; /* Ugh. */ + else + # endif /* HPUX9 */ *limptr = value; return 0; *************** *** 487,490 **** --- 491,498 ---- if (getrlimit (limits[ind].parameter, &limit) < 0) return -1; + # if defined (HPUX9) + if (limits[ind].parameter == RLIMIT_FILESIZE) + newlim /= 512; /* Ugh. */ + # endif /* HPUX9 */ val = (current_user.euid != 0 && newlim == RLIM_INFINITY && (limit.rlim_cur <= limit.rlim_max)) *************** *** 503,509 **** } ! static RLIMTYPE ! getmaxvm (mode) int mode; { #if defined (HAVE_RESOURCE) --- 511,518 ---- } ! static int ! getmaxvm (mode, valuep) int mode; + RLIMTYPE *valuep; { #if defined (HAVE_RESOURCE) *************** *** 512,572 **** if (getrlimit (RLIMIT_DATA, &rl) < 0) ! return (RLIM_INVALID); else maxdata = (mode & LIMIT_SOFT) ? rl.rlim_cur : rl.rlim_max; if (getrlimit (RLIMIT_STACK, &rl) < 0) ! return (RLIM_INVALID); else maxstack = (mode & LIMIT_SOFT) ? rl.rlim_cur : rl.rlim_max; /* Protect against overflow. */ ! return ((maxdata / 1024L) + (maxstack / 1024L)); #else errno = EINVAL; ! return RLIM_INVALID; #endif /* HAVE_RESOURCE */ } ! static RLIMTYPE ! filesize() { #if !defined (HAVE_RESOURCE) ! return ((RLIMTYPE)ulimit (1, 0L)); #else errno = EINVAL; ! return RLIM_INVALID; #endif } ! static RLIMTYPE ! pipesize () { #if defined (PIPE_BUF) /* This is defined on Posix systems. */ ! return ((RLIMTYPE) PIPE_BUF); #else # if defined (PIPESIZE) /* This is defined by running a program from the Makefile. */ ! return ((RLIMTYPE) PIPESIZE); # else errno = EINVAL; ! return RLIM_INVALID; # endif /* PIPESIZE */ #endif /* PIPE_BUF */ } ! static RLIMTYPE ! getmaxuprc (mode) int mode; { # if defined (HAVE_SYSCONF) && defined (_SC_CHILD_MAX) ! return ((RLIMTYPE)sysconf (_SC_CHILD_MAX)); # else /* !HAVE_SYSCONF || !_SC_CHILD_MAX */ # if defined (MAXUPRC) ! return ((RLIMTYPE)MAXUPRC); # else /* MAXUPRC */ errno = EINVAL; ! return RLIM_INVALID; # endif /* !MAXUPRC */ # endif /* !HAVE_SYSCONF || !_SC_CHILD_MAX */ --- 521,599 ---- if (getrlimit (RLIMIT_DATA, &rl) < 0) ! return -1; else maxdata = (mode & LIMIT_SOFT) ? rl.rlim_cur : rl.rlim_max; if (getrlimit (RLIMIT_STACK, &rl) < 0) ! return -1; else maxstack = (mode & LIMIT_SOFT) ? rl.rlim_cur : rl.rlim_max; /* Protect against overflow. */ ! *valuep = (maxdata / 1024L) + (maxstack / 1024L); ! return 0; #else errno = EINVAL; ! return -1; #endif /* HAVE_RESOURCE */ } ! static int ! filesize(valuep) ! RLIMTYPE *valuep; { #if !defined (HAVE_RESOURCE) ! long result; ! if ((result = ulimit (1, 0L)) < 0) ! return -1; ! else ! *valuep = (RLIMTYPE) result; ! return 0; #else errno = EINVAL; ! return -1; #endif } ! static int ! pipesize (valuep) ! RLIMTYPE *valuep; { #if defined (PIPE_BUF) /* This is defined on Posix systems. */ ! *valuep = (RLIMTYPE) PIPE_BUF; ! return 0; #else # if defined (PIPESIZE) /* This is defined by running a program from the Makefile. */ ! *valuep = (RLIMTYPE) PIPESIZE; ! return 0; # else errno = EINVAL; ! return -1; # endif /* PIPESIZE */ #endif /* PIPE_BUF */ } ! static int ! getmaxuprc (mode, valuep) int mode; + RLIMTYPE *valuep; { # if defined (HAVE_SYSCONF) && defined (_SC_CHILD_MAX) ! long maxchild; ! maxchild = sysconf (_SC_CHILD_MAX); ! if (maxchild < 0) ! return -1; ! else ! *valuep = (RLIMTYPE) maxchild; ! return 0; # else /* !HAVE_SYSCONF || !_SC_CHILD_MAX */ # if defined (MAXUPRC) ! *valuep = (RLIMTYPE) MAXUPRC; ! return 0; # else /* MAXUPRC */ errno = EINVAL; ! return -1; # endif /* !MAXUPRC */ # endif /* !HAVE_SYSCONF || !_SC_CHILD_MAX */ *************** *** 586,591 **** { if (get_limit (i, mode, &value) < 0) ! value = RLIM_INVALID; ! printone (i, value, 1); } } --- 613,622 ---- { if (get_limit (i, mode, &value) < 0) ! { ! fprintf (stderr, DESCFMT, limits[i].description); ! builtin_error ("cannot get limit: %s", strerror (errno)); ! } ! else ! printone (i, value, 1); } } *************** *** 601,606 **** if (curlim == RLIM_INFINITY) puts ("unlimited"); - else if (curlim == RLIM_INVALID) - builtin_error ("cannot get limit: %s\n", strerror (errno)); else print_rlimtype ((curlim / limits[limind].block_factor), 1); --- 632,635 ---- diff -aNrc2 bash-2.02.1/builtins/umask.def bash-2.03/builtins/umask.def *** bash-2.02.1/builtins/umask.def Thu Jul 17 09:45:26 1997 --- bash-2.03/builtins/umask.def Thu May 7 14:03:00 1998 *************** *** 175,201 **** } ! /* Set the umask from a symbolic mode string similar to that accepted ! by chmod. If the -S argument is given, then print the umask in a ! symbolic form. */ ! static int ! symbolic_umask (list) ! WORD_LIST *list; { ! int um, umc, c; ! int who, op, perm, mask; char *s; ! /* Get the initial umask. Don't change it yet. */ ! um = umask (022); ! umask (um); ! ! /* All work below is done with the complement of the umask -- it's ! more intuitive and easier to deal with. It is complemented ! again before being returned. */ ! umc = ~um; ! ! s = list->word->word; ! ! for (;;) { who = op = perm = mask = 0; --- 175,187 ---- } ! int ! parse_symbolic_mode (mode, initial_bits) ! char *mode; ! int initial_bits; { ! int who, op, perm, mask, bits, c; char *s; ! for (s = mode, bits = initial_bits;;) { who = op = perm = mask = 0; *************** *** 206,223 **** switch (c = *s++) { ! case 'u': ! who |= S_IRWXU; ! continue; ! case 'g': ! who |= S_IRWXG; ! continue; ! case 'o': ! who |= S_IRWXO; ! continue; ! case 'a': ! who |= S_IRWXU | S_IRWXG | S_IRWXO; ! continue; ! default: ! break; } } --- 192,209 ---- switch (c = *s++) { ! case 'u': ! who |= S_IRWXU; ! continue; ! case 'g': ! who |= S_IRWXG; ! continue; ! case 'o': ! who |= S_IRWXO; ! continue; ! case 'a': ! who |= S_IRWXU | S_IRWXG | S_IRWXO; ! continue; ! default: ! break; } } *************** *** 227,237 **** switch (op) { ! case '+': ! case '-': ! case '=': ! break; ! default: ! builtin_error ("bad symbolic mode operator: %c", op); ! return (-1); } --- 213,223 ---- switch (op) { ! case '+': ! case '-': ! case '=': ! break; ! default: ! builtin_error ("bad symbolic mode operator: %c", op); ! return (-1); } *************** *** 243,257 **** switch (c) { ! case 'r': ! perm |= S_IRUGO; ! break; ! ! case 'w': ! perm |= S_IWUGO; ! break; ! ! case 'x': ! perm |= S_IXUGO; ! break; } } --- 229,241 ---- switch (c) { ! case 'r': ! perm |= S_IRUGO; ! break; ! case 'w': ! perm |= S_IWUGO; ! break; ! case 'x': ! perm |= S_IXUGO; ! break; } } *************** *** 266,295 **** switch (op) { ! case '+': ! umc |= perm; ! break; ! ! case '-': ! umc &= ~perm; ! break; ! ! case '=': ! umc &= ~who; ! umc |= perm; ! break; ! ! #if 0 ! /* No other values are possible. */ ! default: ! builtin_error ("bad symbolic mode operator: %c", op); ! return (-1); ! #endif ! } ! ! if (!*s) ! { ! um = ~umc & 0777; break; } else s++; /* skip past ',' */ --- 250,269 ---- switch (op) { ! case '+': ! bits |= perm; break; + case '-': + bits &= ~perm; + break; + case '=': + bits &= ~who; + bits |= perm; + break; + + /* No other values are possible. */ } + + if (*s == '\0') + break; else s++; /* skip past ',' */ *************** *** 301,304 **** --- 275,301 ---- } } + + return (bits); + } + + /* Set the umask from a symbolic mode string similar to that accepted + by chmod. If the -S argument is given, then print the umask in a + symbolic form. */ + static int + symbolic_umask (list) + WORD_LIST *list; + { + int um, bits; + + /* Get the initial umask. Don't change it yet. */ + um = umask (022); + umask (um); + + /* All work is done with the complement of the umask -- it's + more intuitive and easier to deal with. It is complemented + again before being returned. */ + bits = parse_symbolic_mode (list->word->word, ~um); + + um = ~bits & 0777; return (um); } diff -aNrc2 bash-2.02.1/command.h bash-2.03/command.h *** bash-2.02.1/command.h Fri Nov 21 13:04:39 1997 --- bash-2.03/command.h Tue Jan 12 12:40:33 1999 *************** *** 64,67 **** --- 64,68 ---- #define W_GLOBEXP 0x08 /* This word is the result of a glob expansion. */ #define W_NOSPLIT 0x10 /* Do not perform word splitting on this word. */ + #define W_NOGLOB 0x20 /* Do not perform globbing on this word. */ /* Possible values for subshell_environment */ *************** *** 268,271 **** --- 269,280 ---- extern COMMAND *global_command; + + /* Possible command errors */ + #define CMDERR_DEFAULT 0 + #define CMDERR_BADTYPE 1 + #define CMDERR_BADCONN 2 + #define CMDERR_BADJUMP 3 + + #define CMDERR_LAST 3 /* Forward declarations of functions declared in copy_cmd.c. */ diff -aNrc2 bash-2.02.1/config-bot.h bash-2.03/config-bot.h *** bash-2.02.1/config-bot.h Wed Dec 31 19:00:00 1969 --- bash-2.03/config-bot.h Thu Jul 30 11:19:36 1998 *************** *** 0 **** --- 1,71 ---- + /* config.h.bot */ + /* modify settings or make new ones based on what autoconf tells us. */ + + #if !defined (HAVE_VPRINTF) && defined (HAVE_DOPRNT) + # define USE_VFPRINTF_EMULATION + # define HAVE_VPRINTF + #endif + + /* Ultrix botches type-ahead when switching from canonical to + non-canonical mode, at least through version 4.3 */ + #if !defined (HAVE_TERMIOS_H) || !defined (HAVE_TCGETATTR) || defined (ultrix) + # define TERMIOS_MISSING + #endif + + /* If we have a getcwd(3), but it calls popen(), #undef HAVE_GETCWD so + the replacement in getcwd.c will be built. */ + #if defined (HAVE_GETCWD) && defined (GETCWD_BROKEN) + # undef HAVE_GETCWD + #endif + + #if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_GETRLIMIT) + # define HAVE_RESOURCE + #endif + + #if !defined (GETPGRP_VOID) + # define HAVE_BSD_PGRP + #endif + + #if !defined (HAVE_DEV_FD) && defined (NAMED_PIPES_MISSING) + # undef PROCESS_SUBSTITUTION + #endif + + /* If the shell is called by this name, it will become restricted. */ + #if defined (RESTRICTED_SHELL) + # define RESTRICTED_SHELL_NAME "rbash" + #endif + + /* BANG_HISTORY requires HISTORY. */ + #if defined (BANG_HISTORY) && !defined (HISTORY) + # define HISTORY + #endif /* BANG_HISTORY && !HISTORY */ + + #if defined (READLINE) && !defined (HISTORY) + # define HISTORY + #endif + + #if !defined (V9_ECHO) + # undef DEFAULT_ECHO_TO_USG + #endif + + #if defined (JOB_CONTROL_MISSING) + # undef JOB_CONTROL + #endif + + #if defined (__STDC__) && defined (HAVE_STDARG_H) + # define PREFER_STDARG + # define USE_VARARGS + #else + # if defined (HAVE_VARARGS_H) + # define PREFER_VARARGS + # define USE_VARARGS + # endif + #endif + + #if defined (STRCOLL_BROKEN) + # undef HAVE_STRCOLL + #endif + + #if !defined (PROMPT_STRING_DECODE) + # define PPROMPT "$ " + #endif diff -aNrc2 bash-2.02.1/config-top.h bash-2.03/config-top.h *** bash-2.02.1/config-top.h Wed Dec 31 19:00:00 1969 --- bash-2.03/config-top.h Tue Dec 15 13:24:38 1998 *************** *** 0 **** --- 1,55 ---- + /* config.h.top */ + + /* This contains various user-settable options not under the control of + autoconf. */ + + /* Define CONTINUE_AFTER_KILL_ERROR if you want the kill command to + continue processing arguments after one of them fails. This is + what POSIX.2 specifies. */ + #define CONTINUE_AFTER_KILL_ERROR + + /* Define BREAK_COMPLAINS if you want the non-standard, but useful + error messages about `break' and `continue' out of context. */ + #define BREAK_COMPLAINS + + /* Define BUFFERED_INPUT if you want the shell to do its own input + buffering, rather than using stdio. Do not undefine this; it's + required to preserve semantics required by POSIX. */ + #define BUFFERED_INPUT + + /* Define ONESHOT if you want sh -c 'command' to avoid forking to execute + `command' whenever possible. This is a big efficiency improvement. */ + #define ONESHOT + + /* Define V9_ECHO if you want to give the echo builtin backslash-escape + interpretation using the -e option, in the style of the Bell Labs 9th + Edition version of echo. You cannot emulate the System V echo behavior + without this option. */ + #define V9_ECHO + + /* Define DONT_REPORT_SIGPIPE if you don't want to see `Broken pipe' messages + when a job like `cat jobs.c | exit 1' is executed. */ + /* #define DONT_REPORT_SIGPIPE */ + + /* The default value of the PATH variable. */ + #ifndef DEFAULT_PATH_VALUE + #define DEFAULT_PATH_VALUE \ + "/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:." + #endif + + /* The value for PATH when invoking `command -p'. This is only used when + the Posix.2 confstr () function, or CS_PATH define are not present. */ + #ifndef STANDARD_UTILS_PATH + #define STANDARD_UTILS_PATH \ + "/bin:/usr/bin:/usr/ucb:/sbin:/usr/sbin:/etc:/usr/etc" + #endif + + /* Default primary and secondary prompt strings. */ + #define PPROMPT "\\s-\\v\\$ " + #define SPROMPT "> " + + /* System-wide .bashrc file for interactive shells. */ + /* #define SYS_BASHRC "/etc/bash.bashrc" */ + + /* System-wide .bash_logout for login shells. */ + /* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */ diff -aNrc2 bash-2.02.1/config.h.bot bash-2.03/config.h.bot *** bash-2.02.1/config.h.bot Mon Mar 10 15:14:19 1997 --- bash-2.03/config.h.bot Wed Dec 31 19:00:00 1969 *************** *** 1,67 **** - /* config.h.bot */ - /* modify settings or make new ones based on what autoconf tells us. */ - - #if !defined (HAVE_VPRINTF) && defined (HAVE_DOPRNT) - # define USE_VFPRINTF_EMULATION - # define HAVE_VPRINTF - #endif - - /* Ultrix botches type-ahead when switching from canonical to - non-canonical mode, at least through version 4.3 */ - #if !defined (HAVE_TERMIOS_H) || !defined (HAVE_TCGETATTR) || defined (ultrix) - # define TERMIOS_MISSING - #endif - - /* If we have a getcwd(3), but it calls popen(), #undef HAVE_GETCWD so - the replacement in getcwd.c will be built. */ - #if defined (HAVE_GETCWD) && defined (GETCWD_BROKEN) - # undef HAVE_GETCWD - #endif - - #if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_GETRLIMIT) - # define HAVE_RESOURCE - #endif - - #if !defined (GETPGRP_VOID) - # define HAVE_BSD_PGRP - #endif - - #if !defined (HAVE_DEV_FD) && defined (NAMED_PIPES_MISSING) - # undef PROCESS_SUBSTITUTION - #endif - - /* If the shell is called by this name, it will become restricted. */ - #if defined (RESTRICTED_SHELL) - # define RESTRICTED_SHELL_NAME "rbash" - #endif - - /* BANG_HISTORY requires HISTORY. */ - #if defined (BANG_HISTORY) && !defined (HISTORY) - # define HISTORY - #endif /* BANG_HISTORY && !HISTORY */ - - #if defined (READLINE) && !defined (HISTORY) - # define HISTORY - #endif - - #if !defined (V9_ECHO) - # undef DEFAULT_ECHO_TO_USG - #endif - - #if defined (JOB_CONTROL_MISSING) - # undef JOB_CONTROL - #endif - - #if defined (__STDC__) && defined (HAVE_STDARG_H) - # define PREFER_STDARG - # define USE_VARARGS - #else - # if defined (HAVE_VARARGS_H) - # define PREFER_VARARGS - # define USE_VARARGS - # endif - #endif - - #if defined (STRCOLL_BROKEN) - # undef HAVE_STRCOLL - #endif --- 0 ---- diff -aNrc2 bash-2.02.1/config.h.in bash-2.03/config.h.in *** bash-2.02.1/config.h.in Thu Oct 9 11:43:00 1997 --- bash-2.03/config.h.in Thu Feb 18 11:48:31 1999 *************** *** 123,129 **** /* End of configuration settings controllable by autoconf. */ ! /* Other settable options appear in config.h.top. */ ! #include "config.h.top" /* Beginning of autoconf additions. */ --- 123,129 ---- /* End of configuration settings controllable by autoconf. */ ! /* Other settable options appear in config-top.h. */ ! #include "config-top.h" /* Beginning of autoconf additions. */ *************** *** 188,191 **** --- 188,194 ---- #undef SIZEOF_CHAR_P + /* The number of bytes in a double (hopefully 8). */ + #undef SIZEOF_DOUBLE + /* Define to `long' if doesn't define. */ #undef off_t *************** *** 209,212 **** --- 212,218 ---- #undef ptrdiff_t + /* Define to `double' if doesn't define. */ + #undef bits64_t + /* Define to `unsigned' if doesn't define. */ #undef size_t *************** *** 393,396 **** --- 399,403 ---- #undef HAVE_KILLPG + /* Define if you have the lstat function. */ #undef HAVE_LSTAT *************** *** 398,401 **** --- 405,414 ---- #undef HAVE_PUTENV + /* Define if you have the rename function. */ + #undef HAVE_RENAME + + /* Define if you have the sbrk function. */ + #undef HAVE_SBRK + /* Define if you have the select function. */ #undef HAVE_SELECT *************** *** 543,546 **** --- 556,562 ---- #undef HAVE_LIBSOCKET + /* Are we running SVR5 (UnixWare 7)? */ + #undef SVR5 + /* Are we running SVR4.2? */ #undef SVR4_2 *************** *** 556,560 **** #undef STRCOLL_BROKEN ! #include "config.h.bot" #endif /* _CONFIG_H_ */ --- 572,576 ---- #undef STRCOLL_BROKEN ! #include "config-bot.h" #endif /* _CONFIG_H_ */ diff -aNrc2 bash-2.02.1/config.h.top bash-2.03/config.h.top *** bash-2.02.1/config.h.top Thu Mar 6 11:38:39 1997 --- bash-2.03/config.h.top Wed Dec 31 19:00:00 1969 *************** *** 1,55 **** - /* config.h.top */ - - /* This contains various user-settable options not under the control of - autoconf. */ - - /* Define CONTINUE_AFTER_KILL_ERROR if you want the kill command to - continue processing arguments after one of them fails. This is - what POSIX.2 specifies. */ - #define CONTINUE_AFTER_KILL_ERROR - - /* Define BREAK_COMPLAINS if you want the non-standard, but useful - error messages about `break' and `continue' out of context. */ - #define BREAK_COMPLAINS - - /* Define BUFFERED_INPUT if you want the shell to do its own input - buffering, rather than using stdio. Do not undefine this; it's - required to preserve semantics required by POSIX. */ - #define BUFFERED_INPUT - - /* Define ONESHOT if you want sh -c 'command' to avoid forking to execute - `command' whenever possible. This is a big efficiency improvement. */ - #define ONESHOT - - /* Define V9_ECHO if you want to give the echo builtin backslash-escape - interpretation using the -e option, in the style of the Bell Labs 9th - Edition version of echo. You cannot emulate the System V echo behavior - without this option. */ - #define V9_ECHO - - /* Define DONT_REPORT_SIGPIPE if you don't want to see `Broken pipe' messages - when a job like `cat jobs.c | exit 1' is executed. */ - /* #define DONT_REPORT_SIGPIPE */ - - /* The default value of the PATH variable. */ - #ifndef DEFAULT_PATH_VALUE - #define DEFAULT_PATH_VALUE \ - "/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:." - #endif - - /* The value for PATH when invoking `command -p'. This is only used when - the Posix.2 confstr () function, or CS_PATH define are not present. */ - #ifndef STANDARD_UTILS_PATH - #define STANDARD_UTILS_PATH \ - "/bin:/usr/bin:/usr/ucb:/sbin:/usr/sbin:/etc:/usr/etc" - #endif - - /* Default primary and secondary prompt strings. */ - #define PPROMPT "\\s-\\v\\$ " - #define SPROMPT "> " - - /* System-wide .bashrc file for interactive shells. */ - /* #define SYS_BASHRC "/etc/bash.bashrc" */ - - /* System-wide .bash_logout for login shells. */ - /* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */ --- 0 ---- diff -aNrc2 bash-2.02.1/configure bash-2.03/configure *** bash-2.02.1/configure Thu Jul 16 15:09:16 1998 --- bash-2.03/configure Thu Feb 18 13:12:00 1999 *************** *** 1,5 **** #! /bin/sh ! # From configure.in for Bash 2.02, version 2.19, from autoconf version 2.12 --- 1,8 ---- #! /bin/sh ! # From configure.in for Bash 2.03, version 2.49, from autoconf version 2.12 ! ! ! *************** *** 107,110 **** --- 110,115 ---- --with-gnu-malloc use the GNU version of malloc" ac_help="$ac_help + --with-installed-readline use a version of the readline library that is already installed" + ac_help="$ac_help --with-purecov configure to postprocess with pure coverage" ac_help="$ac_help *************** *** 692,696 **** echo $ac_n "checking host system type""... $ac_c" 1>&6 ! echo "configure:695: checking host system type" >&5 host_alias=$host --- 697,701 ---- echo $ac_n "checking host system type""... $ac_c" 1>&6 ! echo "configure:700: checking host system type" >&5 host_alias=$host *************** *** 719,738 **** opt_afs=no opt_curses=no case "${host_cpu}-${host_os}" in ! alpha-*) opt_gnu_malloc=no ;; # alpha running osf/1 or linux *Ccray*-*) opt_gnu_malloc=no ;; # Crays *-osf1*) opt_gnu_malloc=no ;; # other osf/1 machines sparc-svr4*) opt_gnu_malloc=no ;; # sparc SVR4, SVR4.2 sparc-netbsd*) opt_gnu_malloc=no ;; # needs 8-byte alignment ! #mips-irix6*) opt_gnu_malloc=no ;; # needs 8-byte alignment sparc-linux*) opt_gnu_malloc=no ;; # sparc running linux; requires ELF #*-freebsd*) opt_gnu_malloc=no ;; # they claim it's better *-aix*) opt_gnu_malloc=no ;; # AIX machines *-nextstep*) opt_gnu_malloc=no ;; # NeXT machines running NeXTstep *-dgux*) opt_gnu_malloc=no ;; # DG/UX machines *-qnx*) opt_gnu_malloc=no ;; # QNX 4.2 *-machten4) opt_gnu_malloc=no ;; # MachTen 4.x *-bsdi2.1|*-bsdi3.?) opt_gnu_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins *-cygwin32*) opt_gnu_malloc=no ;; # Cygnus's CYGWIN32 environment esac --- 724,746 ---- opt_afs=no opt_curses=no + opt_with_installed_readline=no case "${host_cpu}-${host_os}" in ! alpha*-*) opt_gnu_malloc=no ;; # alpha running osf/1 or linux *Ccray*-*) opt_gnu_malloc=no ;; # Crays *-osf1*) opt_gnu_malloc=no ;; # other osf/1 machines sparc-svr4*) opt_gnu_malloc=no ;; # sparc SVR4, SVR4.2 sparc-netbsd*) opt_gnu_malloc=no ;; # needs 8-byte alignment ! mips-irix6*) opt_gnu_malloc=no ;; # needs 8-byte alignment sparc-linux*) opt_gnu_malloc=no ;; # sparc running linux; requires ELF #*-freebsd*) opt_gnu_malloc=no ;; # they claim it's better *-aix*) opt_gnu_malloc=no ;; # AIX machines *-nextstep*) opt_gnu_malloc=no ;; # NeXT machines running NeXTstep + *-rhapsody*) opt_gnu_malloc=no ;; # Apple Rhapsody *-dgux*) opt_gnu_malloc=no ;; # DG/UX machines *-qnx*) opt_gnu_malloc=no ;; # QNX 4.2 *-machten4) opt_gnu_malloc=no ;; # MachTen 4.x *-bsdi2.1|*-bsdi3.?) opt_gnu_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins + *-beos*) opt_gnu_malloc=no ;; # they say it's suitable *-cygwin32*) opt_gnu_malloc=no ;; # Cygnus's CYGWIN32 environment esac *************** *** 762,765 **** --- 770,779 ---- fi + # Check whether --with-installed-readline or --without-installed-readline was given. + if test "${with_installed_readline+set}" = set; then + withval="$with_installed_readline" + opt_with_installed_readline=$withval + fi + # Check whether --with-purecov or --without-purecov was given. if test "${with_purecov+set}" = set; then *************** *** 977,980 **** --- 991,995 ---- + if test $opt_alias = yes; then cat >> confdefs.h <<\EOF *************** *** 983,1016 **** fi - if test $opt_readline = yes; then - cat >> confdefs.h <<\EOF - #define READLINE 1 - EOF - - READLINE_LIB=-lreadline - READLINE_DEP='$(READLINE_LIBRARY)' - else - READLINE_LIB= READLINE_DEP= - fi - if test $opt_history = yes; then - cat >> confdefs.h <<\EOF - #define HISTORY 1 - EOF - - HISTORY_LIB=-lhistory - HISTORY_DEP='$(HISTORY_LIBRARY)' - else - HISTORY_LIB= HISTORY_DEP= - fi - if test $opt_bang_history = yes; then - cat >> confdefs.h <<\EOF - #define BANG_HISTORY 1 - EOF - - HISTORY_LIB=-lhistory - HISTORY_DEP='$(HISTORY_LIBRARY)' - else - HISTORY_LIB= HISTORY_DEP= - fi if test $opt_dirstack = yes; then cat >> confdefs.h <<\EOF --- 998,1001 ---- *************** *** 1109,1118 **** ! ! ! ! ! BASHVERS=2.02 ! BASHPATCH=1 echo "Beginning configuration for bash-$BASHVERS for ${host_cpu}-${host_vendor}-${host_os}" --- 1094,1099 ---- ! BASHVERS=2.03 ! BASHPATCH=0 echo "Beginning configuration for bash-$BASHVERS for ${host_cpu}-${host_vendor}-${host_os}" *************** *** 1121,1125 **** set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1124: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1102,1106 ---- set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1105: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1150,1154 **** set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1153: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1131,1135 ---- set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1134: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1198,1202 **** echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:1201: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c --- 1179,1183 ---- echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:1182: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c *************** *** 1208,1216 **** cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. --- 1189,1197 ---- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. *************** *** 1232,1241 **** fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:1235: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1240: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1213,1222 ---- fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:1216: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1221: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1246,1250 **** #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else --- 1227,1231 ---- #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1230: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else *************** *** 1261,1265 **** CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1264: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1242,1246 ---- CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1245: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1289,1293 **** echo $ac_n "checking whether large file support needs explicit enabling""... $ac_c" 1>&6 ! echo "configure:1292: checking whether large file support needs explicit enabling" >&5 ac_getconfs='' ac_result=yes --- 1270,1274 ---- echo $ac_n "checking whether large file support needs explicit enabling""... $ac_c" 1>&6 ! echo "configure:1273: checking whether large file support needs explicit enabling" >&5 ac_getconfs='' ac_result=yes *************** *** 1321,1325 **** echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 ! echo "configure:1324: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 --- 1302,1306 ---- echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 ! echo "configure:1305: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 *************** *** 1342,1346 **** echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1345: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then --- 1323,1327 ---- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1326: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then *************** *** 1357,1361 **** # not just through cpp. cat > conftest.$ac_ext < --- 1338,1342 ---- # not just through cpp. cat > conftest.$ac_ext < *************** *** 1363,1367 **** EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 1344,1348 ---- EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** *** 1374,1378 **** CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < --- 1355,1359 ---- CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < *************** *** 1380,1384 **** EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 1361,1365 ---- EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** *** 1404,1418 **** ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 ! echo "configure:1407: checking for minix/config.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1417: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 1385,1399 ---- ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 ! echo "configure:1388: checking for minix/config.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1398: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** *** 1453,1471 **** if test "x$cross_compiling" = "xyes"; then case "${host}" in *-cygwin32*) cross_cache=${srcdir}/cross-build/cygwin32.cache ! if test -r "${cross_cache}"; then ! echo "loading cross-build cache file ${cross_cache}" ! . ${cross_cache} ! fi ! unset cross_cache ;; ! *) echo "configure: cross-compiling for a non-cygwin32 target is not supported" >&2 ;; esac fi if test -z "$CC_FOR_BUILD"; then if test "x$cross_compiling" = "xno"; then --- 1434,1462 ---- + SIGNAMES_H=lsignames.h + + + if test "x$cross_compiling" = "xyes"; then case "${host}" in *-cygwin32*) cross_cache=${srcdir}/cross-build/cygwin32.cache ! SIGNAMES_H='$(srcdir)/cross-build/win32sig.h' ;; ! i[3456]86-*-beos*) ! cross_cache=${srcdir}/cross-build/x86-beos.cache ! SIGNAMES_H='${srcdir}/cross-build/beos-sig.h' ! ;; ! *) echo "configure: cross-compiling for $host is not supported" >&2 ;; esac + if test -n "${cross_cache}" && test -r "${cross_cache}"; then + echo "loading cross-build cache file ${cross_cache}" + . ${cross_cache} + fi + unset cross_cache fi + if test -z "$CC_FOR_BUILD"; then if test "x$cross_compiling" = "xno"; then *************** *** 1477,1487 **** - if test "x$cross_compiling" = "xno"; then - SIGNAMES_H=lsignames.h - else - SIGNAMES_H='$(srcdir)/cross-build/win32sig.h' - fi - - test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1 --- 1468,1471 ---- *************** *** 1491,1495 **** if test "$opt_profiling" = "yes"; then PROFILE_FLAGS=-pg ! opt_static_link=yes fi --- 1475,1482 ---- if test "$opt_profiling" = "yes"; then PROFILE_FLAGS=-pg ! case "$host_os" in ! solaris2*) ;; ! *) opt_static_link=yes ;; ! esac fi *************** *** 1497,1501 **** # if we're using gcc, add `-static' to LDFLAGS if test -n "$GCC" || test "$ac_cv_prog_gcc" = "yes"; then ! LDFLAGS="$LDFLAGS -static" fi fi --- 1484,1488 ---- # if we're using gcc, add `-static' to LDFLAGS if test -n "$GCC" || test "$ac_cv_prog_gcc" = "yes"; then ! STATIC_LD="-static" fi fi *************** *** 1505,1511 **** if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 ! echo "configure:1510: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1492,1499 ---- + if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 ! echo "configure:1498: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1513,1517 **** ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < --- 1501,1505 ---- ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < *************** *** 1531,1535 **** if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < --- 1519,1523 ---- if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < *************** *** 1553,1556 **** --- 1541,1620 ---- + + if test "$opt_readline" = yes && test "$opt_with_installed_readline" = "yes" + then + + + test "x$prefix" = xNONE && _rl_prefix=$ac_default_prefix || _rl_prefix=${prefix} + test "x$exec_prefix" = xNONE && _rl_exec_prefix=${_rl_prefix} || _rl_exec_prefix=${exec_prefix} + + echo $ac_n "checking version of installed readline library""... $ac_c" 1>&6 + echo "configure:1553: checking version of installed readline library" >&5 + _rl_version=`exec_prefix=${_rl_exec_prefix} ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/rlvers.sh -C "${CC}" -L ${libdir}` + echo "$ac_t""$_rl_version" 1>&6 + + case "$_rl_version" in + 3*|4*|5*|6*|7*|8*|9*) ;; + *) opt_with_installed_readline=no + echo "configure: warning: installed readline library is too old to be linked with bash" 1>&2 + echo "configure: warning: using private bash version" 1>&2 + ;; + esac + unset _rl_version _rl_prefix _rl_exec_prefix + fi + + if test $opt_readline = yes; then + cat >> confdefs.h <<\EOF + #define READLINE 1 + EOF + + READLINE_LIB=-lreadline + if test "$opt_with_installed_readline" = "yes" ; then + RL_LIBDIR='$(libdir)' + READLINE_DEP= + RL_INCLUDE='-I$(includedir)' + else + RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + READLINE_DEP='$(READLINE_LIBRARY)' + fi + else + RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + READLINE_LIB= READLINE_DEP= + fi + if test $opt_history = yes || test $opt_bang_history = yes; then + if test $opt_history = yes; then + cat >> confdefs.h <<\EOF + #define HISTORY 1 + EOF + + fi + if test $opt_bang_history = yes; then + cat >> confdefs.h <<\EOF + #define BANG_HISTORY 1 + EOF + + fi + HISTORY_LIB=-lhistory + if test "$opt_with_installed_readline" = "yes"; then + HIST_LIBDIR='$(libdir)' + HISTORY_DEP= + RL_INCLUDE='-I$(includedir)' + else + HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + HISTORY_DEP='$(HISTORY_LIBRARY)' + fi + else + HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + HISTORY_LIB= HISTORY_DEP= + fi + + + + + + + + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or *************** *** 1564,1568 **** # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:1567: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then --- 1628,1632 ---- # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:1631: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then *************** *** 1616,1620 **** set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1619: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1680,1684 ---- set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1683: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1641,1648 **** fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1647: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1705,1713 ---- fi + test -n "$ARFLAGS" || ARFLAGS="cr" # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1712: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1675,1679 **** set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1678: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1740,1744 ---- set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1743: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1705,1709 **** echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ! echo "configure:1708: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then --- 1770,1774 ---- echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ! echo "configure:1773: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then *************** *** 1732,1744 **** # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ! echo "configure:1738: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 1797,1815 ---- + case "$host_os" in + opennt*|interix*) MAKE_SHELL="$OPENNT_ROOT/bin/sh" ;; + *) MAKE_SHELL=/bin/sh ;; + esac + + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ! echo "configure:1809: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 1747,1751 **** ; return 0; } EOF ! if { (eval echo configure:1750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes --- 1818,1822 ---- ; return 0; } EOF ! if { (eval echo configure:1821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes *************** *** 1768,1777 **** echo $ac_n "checking for alloca""... $ac_c" 1>&6 ! echo "configure:1771: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1842: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes --- 1867,1871 ---- ; return 0; } EOF ! if { (eval echo configure:1870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes *************** *** 1828,1837 **** echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 ! echo "configure:1831: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1902: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1861: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1932: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 1957,1961 ---- ; return 0; } EOF ! if { (eval echo configure:1960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 1913,1917 **** echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:1916: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1984,1988 ---- echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:1987: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1921,1925 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 --- 2011,2015 ---- } EOF ! if { (eval echo configure:2014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 *************** *** 1962,1966 **** echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 ! echo "configure:1965: checking whether getpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2033,2037 ---- echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 ! echo "configure:2036: checking whether getpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1970,1974 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_getpgrp_void=yes --- 2096,2100 ---- EOF ! if { (eval echo configure:2099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_getpgrp_void=yes *************** *** 2049,2053 **** echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6 ! echo "configure:2052: checking whether setvbuf arguments are reversed" >&5 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2120,2124 ---- echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6 ! echo "configure:2123: checking whether setvbuf arguments are reversed" >&5 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2057,2061 **** else cat > conftest.$ac_ext < --- 2128,2132 ---- else cat > conftest.$ac_ext < *************** *** 2071,2075 **** } EOF ! if { (eval echo configure:2074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_setvbuf_reversed=yes --- 2142,2146 ---- } EOF ! if { (eval echo configure:2145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_setvbuf_reversed=yes *************** *** 2095,2104 **** echo $ac_n "checking for vprintf""... $ac_c" 1>&6 ! echo "configure:2098: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2169: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" --- 2194,2198 ---- ; return 0; } EOF ! if { (eval echo configure:2197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" *************** *** 2147,2156 **** if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 ! echo "configure:2150: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2221: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" --- 2246,2250 ---- ; return 0; } EOF ! if { (eval echo configure:2249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" *************** *** 2200,2204 **** echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6 ! echo "configure:2203: checking for wait3 that fills in rusage" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2271,2275 ---- echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6 ! echo "configure:2274: checking for wait3 that fills in rusage" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2208,2212 **** else cat > conftest.$ac_ext < --- 2279,2283 ---- else cat > conftest.$ac_ext < *************** *** 2239,2243 **** } EOF ! if { (eval echo configure:2242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_wait3_rusage=yes --- 2310,2314 ---- } EOF ! if { (eval echo configure:2313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_wait3_rusage=yes *************** *** 2262,2266 **** echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 ! echo "configure:2265: checking for working strcoll" >&5 if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2333,2337 ---- echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 ! echo "configure:2336: checking for working strcoll" >&5 if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2270,2274 **** else cat > conftest.$ac_ext < --- 2341,2345 ---- else cat > conftest.$ac_ext < *************** *** 2280,2284 **** } EOF ! if { (eval echo configure:2283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_strcoll_works=yes --- 2351,2355 ---- } EOF ! if { (eval echo configure:2354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_strcoll_works=yes *************** *** 2305,2311 **** if test "$ac_cv_func_vprintf" = no; then echo $ac_n "checking for declaration of vprintf in stdio.h""... $ac_c" 1>&6 ! echo "configure:2308: checking for declaration of vprintf in stdio.h" >&5 cat > conftest.$ac_ext < --- 2376,2382 ---- if test "$ac_cv_func_vprintf" = no; then echo $ac_n "checking for declaration of vprintf in stdio.h""... $ac_c" 1>&6 ! echo "configure:2379: checking for declaration of vprintf in stdio.h" >&5 cat > conftest.$ac_ext < *************** *** 2328,2337 **** echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:2331: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 2399,2408 ---- echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:2402: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 2350,2354 **** ; return 0; } EOF ! if { (eval echo configure:2353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void --- 2421,2425 ---- ; return 0; } EOF ! if { (eval echo configure:2424: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void *************** *** 2370,2379 **** echo $ac_n "checking for __setostype""... $ac_c" 1>&6 ! echo "configure:2373: checking for __setostype" >&5 if eval "test \"`echo '$''{'ac_cv_func___setostype'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2444: checking for __setostype" >&5 if eval "test \"`echo '$''{'ac_cv_func___setostype'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func___setostype=yes" --- 2469,2473 ---- ; return 0; } EOF ! if { (eval echo configure:2472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func___setostype=yes" *************** *** 2421,2430 **** echo $ac_n "checking for wait3""... $ac_c" 1>&6 ! echo "configure:2424: checking for wait3" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2495: checking for wait3" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_wait3=yes" --- 2520,2524 ---- ; return 0; } EOF ! if { (eval echo configure:2523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_wait3=yes" *************** *** 2473,2482 **** echo $ac_n "checking for mkfifo""... $ac_c" 1>&6 ! echo "configure:2476: checking for mkfifo" >&5 if eval "test \"`echo '$''{'ac_cv_func_mkfifo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2547: checking for mkfifo" >&5 if eval "test \"`echo '$''{'ac_cv_func_mkfifo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_mkfifo=yes" --- 2572,2576 ---- ; return 0; } EOF ! if { (eval echo configure:2575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_mkfifo=yes" *************** *** 2529,2542 **** for ac_func in dup2 select getdtablesize getgroups gethostname \ ! setdtablesize getpagesize killpg lstat getpeername \ ! getrlimit getrusage gettimeofday waitpid tcgetpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2536: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2607: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 2632,2636 ---- ; return 0; } EOF ! if { (eval echo configure:2635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 2592,2601 **** do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2595: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2666: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 2691,2695 ---- ; return 0; } EOF ! if { (eval echo configure:2694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 2649,2663 **** ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2652: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 2720,2734 ---- ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2723: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** *** 2688,2697 **** do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2691: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2762: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 2787,2791 ---- ; return 0; } EOF ! if { (eval echo configure:2790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 2743,2747 **** if test "$ac_cv_func_bindtextdomain" = "no"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 ! echo "configure:2746: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 2814,2818 ---- if test "$ac_cv_func_bindtextdomain" = "no"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 ! echo "configure:2817: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 2751,2755 **** LIBS="-lintl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 2833,2837 ---- ; return 0; } EOF ! if { (eval echo configure:2836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 2793,2802 **** do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2796: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2867: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 2892,2896 ---- ; return 0; } EOF ! if { (eval echo configure:2895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 2850,2854 **** if test "$opt_static_link" != yes; then echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 ! echo "configure:2853: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 2921,2925 ---- if test "$opt_static_link" != yes; then echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 ! echo "configure:2924: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 2858,2862 **** LIBS="-ldl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 2940,2944 ---- ; return 0; } EOF ! if { (eval echo configure:2943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 2899,2908 **** do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2902: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2973: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 2998,3002 ---- ; return 0; } EOF ! if { (eval echo configure:3001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 2954,2963 **** echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 ! echo "configure:2957: checking for sys_siglist declaration in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3025,3034 ---- echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 ! echo "configure:3028: checking for sys_siglist declaration in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 2971,2975 **** ; return 0; } EOF ! if { (eval echo configure:2974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes --- 3042,3046 ---- ; return 0; } EOF ! if { (eval echo configure:3045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes *************** *** 2997,3006 **** ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:3000: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3068,3077 ---- ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:3071: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3010,3014 **** ; return 0; } EOF ! if { (eval echo configure:3013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" --- 3081,3085 ---- ; return 0; } EOF ! if { (eval echo configure:3084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" *************** *** 3035,3039 **** if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:3038: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 3106,3110 ---- if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:3109: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 3043,3047 **** LIBS="-ldir $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 3125,3129 ---- ; return 0; } EOF ! if { (eval echo configure:3128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 3076,3080 **** else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:3079: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 3147,3151 ---- else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:3150: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 3084,3088 **** LIBS="-lx $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 3166,3170 ---- ; return 0; } EOF ! if { (eval echo configure:3169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 3118,3127 **** echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 ! echo "configure:3121: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3189,3198 ---- echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 ! echo "configure:3192: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3132,3136 **** ; return 0; } EOF ! if { (eval echo configure:3135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes --- 3203,3207 ---- ; return 0; } EOF ! if { (eval echo configure:3206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes *************** *** 3159,3173 **** ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:3162: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 3230,3244 ---- ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:3233: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3243: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** *** 3201,3215 **** ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:3204: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 3272,3286 ---- ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:3275: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** *** 3244,3248 **** else echo $ac_n "checking for socket library""... $ac_c" 1>&6 ! echo "configure:3247: checking for socket library" >&5 _bash_needmsg=yes fi --- 3315,3319 ---- else echo $ac_n "checking for socket library""... $ac_c" 1>&6 ! echo "configure:3318: checking for socket library" >&5 _bash_needmsg=yes fi *************** *** 3251,3255 **** else echo $ac_n "checking for getpeername in -lsocket""... $ac_c" 1>&6 ! echo "configure:3254: checking for getpeername in -lsocket" >&5 ac_lib_var=`echo socket'_'getpeername | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 3322,3326 ---- else echo $ac_n "checking for getpeername in -lsocket""... $ac_c" 1>&6 ! echo "configure:3325: checking for getpeername in -lsocket" >&5 ac_lib_var=`echo socket'_'getpeername | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 3259,3263 **** LIBS="-lsocket -lnsl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 3341,3345 ---- ; return 0; } EOF ! if { (eval echo configure:3344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 3303,3307 **** else echo $ac_n "checking for libnsl""... $ac_c" 1>&6 ! echo "configure:3306: checking for libnsl" >&5 _bash_needmsg=yes fi --- 3374,3378 ---- else echo $ac_n "checking for libnsl""... $ac_c" 1>&6 ! echo "configure:3377: checking for libnsl" >&5 _bash_needmsg=yes fi *************** *** 3310,3314 **** else echo $ac_n "checking for t_open in -lnsl""... $ac_c" 1>&6 ! echo "configure:3313: checking for t_open in -lnsl" >&5 ac_lib_var=`echo nsl'_'t_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 3381,3385 ---- else echo $ac_n "checking for t_open in -lnsl""... $ac_c" 1>&6 ! echo "configure:3384: checking for t_open in -lnsl" >&5 ac_lib_var=`echo nsl'_'t_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 3318,3322 **** LIBS="-lnsl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 3400,3404 ---- ; return 0; } EOF ! if { (eval echo configure:3403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 3374,3383 **** echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 ! echo "configure:3377: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3445,3454 ---- echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 ! echo "configure:3448: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3408,3412 **** echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 ! echo "configure:3411: checking type of array argument to getgroups" >&5 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 3479,3483 ---- echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 ! echo "configure:3482: checking type of array argument to getgroups" >&5 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 3416,3420 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_type_getgroups=gid_t --- 3512,3516 ---- EOF ! if { (eval echo configure:3515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_type_getgroups=gid_t *************** *** 3455,3459 **** if test $ac_cv_type_getgroups = cross; then cat > conftest.$ac_ext < --- 3526,3530 ---- if test $ac_cv_type_getgroups = cross; then cat > conftest.$ac_ext < *************** *** 3479,3488 **** echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:3482: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3550,3559 ---- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:3553: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3492,3496 **** EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3495: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then --- 3563,3567 ---- EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then *************** *** 3509,3513 **** # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < --- 3580,3584 ---- # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < *************** *** 3527,3531 **** # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < --- 3598,3602 ---- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < *************** *** 3548,3552 **** else cat > conftest.$ac_ext < --- 3619,3623 ---- else cat > conftest.$ac_ext < *************** *** 3559,3563 **** EOF ! if { (eval echo configure:3562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : --- 3630,3634 ---- EOF ! if { (eval echo configure:3633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : *************** *** 3583,3592 **** echo $ac_n "checking for off_t""... $ac_c" 1>&6 ! echo "configure:3586: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3654,3663 ---- echo $ac_n "checking for off_t""... $ac_c" 1>&6 ! echo "configure:3657: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3616,3625 **** echo $ac_n "checking for mode_t""... $ac_c" 1>&6 ! echo "configure:3619: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3687,3696 ---- echo $ac_n "checking for mode_t""... $ac_c" 1>&6 ! echo "configure:3690: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3649,3658 **** echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 ! echo "configure:3652: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3720,3729 ---- echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 ! echo "configure:3723: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3683,3692 **** echo $ac_n "checking for pid_t""... $ac_c" 1>&6 ! echo "configure:3686: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3754,3763 ---- echo $ac_n "checking for pid_t""... $ac_c" 1>&6 ! echo "configure:3757: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3716,3725 **** echo $ac_n "checking for size_t""... $ac_c" 1>&6 ! echo "configure:3719: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3787,3796 ---- echo $ac_n "checking for size_t""... $ac_c" 1>&6 ! echo "configure:3790: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3749,3758 **** echo $ac_n "checking for time_t""... $ac_c" 1>&6 ! echo "configure:3752: checking for time_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_time_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3820,3829 ---- echo $ac_n "checking for time_t""... $ac_c" 1>&6 ! echo "configure:3823: checking for time_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_time_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3783,3792 **** echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:3786: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 3854,3863 ---- echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:3857: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3805,3809 **** ; return 0; } EOF ! if { (eval echo configure:3808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void --- 3876,3880 ---- ; return 0; } EOF ! if { (eval echo configure:3879: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void *************** *** 3825,3837 **** echo $ac_n "checking size of int""... $ac_c" 1>&6 ! echo "configure:3828: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < --- 3896,3908 ---- echo $ac_n "checking size of int""... $ac_c" 1>&6 ! echo "configure:3899: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! ac_cv_sizeof_int=4 else cat > conftest.$ac_ext < *************** *** 3844,3848 **** } EOF ! if { (eval echo configure:3847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` --- 3915,3919 ---- } EOF ! if { (eval echo configure:3918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` *************** *** 3864,3876 **** echo $ac_n "checking size of long""... $ac_c" 1>&6 ! echo "configure:3867: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < --- 3935,3947 ---- echo $ac_n "checking size of long""... $ac_c" 1>&6 ! echo "configure:3938: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! ac_cv_sizeof_long=4 else cat > conftest.$ac_ext < *************** *** 3883,3887 **** } EOF ! if { (eval echo configure:3886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` --- 3954,3958 ---- } EOF ! if { (eval echo configure:3957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` *************** *** 3903,3915 **** echo $ac_n "checking size of char *""... $ac_c" 1>&6 ! echo "configure:3906: checking size of char *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_char_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < --- 3974,3986 ---- echo $ac_n "checking size of char *""... $ac_c" 1>&6 ! echo "configure:3977: checking size of char *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_char_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! ac_cv_sizeof_char_p=4 else cat > conftest.$ac_ext < *************** *** 3922,3926 **** } EOF ! if { (eval echo configure:3925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_char_p=`cat conftestval` --- 3993,3997 ---- } EOF ! if { (eval echo configure:3996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_char_p=`cat conftestval` *************** *** 3941,3952 **** ! echo $ac_n "checking for int32_t""... $ac_c" 1>&6 ! echo "configure:3946: checking for int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 4012,4064 ---- + echo $ac_n "checking size of double""... $ac_c" 1>&6 + echo "configure:4016: checking size of double" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then + ac_cv_sizeof_double=8 + else + cat > conftest.$ac_ext < + main() + { + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(double)); + exit(0); + } + EOF + if { (eval echo configure:4035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null + then + ac_cv_sizeof_double=`cat conftestval` + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_double=0 + fi + rm -fr conftest* + fi + + fi + echo "$ac_t""$ac_cv_sizeof_double" 1>&6 + cat >> confdefs.h <&6 ! echo "configure:4058: checking for int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 3970,4051 **** if test $ac_cv_type_int32_t = no; then cat >> confdefs.h <<\EOF ! #define int32_t EOF fi ! if test "$ac_cv_type_int32_t" = "no"; then ! ! if test "X$bash_cv_type_int32_t" = "X"; then ! _bash_needmsg=yes ! else ! echo $ac_n "checking which builtin C type is 32 bits wide""... $ac_c" 1>&6 ! echo "configure:3984: checking which builtin C type is 32 bits wide" >&5 ! _bash_needmsg= ! fi ! if eval "test \"`echo '$''{'bash_cv_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test "$cross_compiling" = yes; then - { echo "configure: error: cannot check type sizes if cross-compiling -- defaulting to int" 1>&2; exit 1; } - bash_cv_type_int32_t=int - - else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null ! then ! bash_cv_type_int32_t=int else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -fr conftest* ! bash_cv_type_int32_t=long fi ! rm -fr conftest* fi fi ! if test "X$_bash_needmsg" = "Xyes"; then ! echo $ac_n "checking which builtin C type is 32 bits wide""... $ac_c" 1>&6 ! echo "configure:4028: checking which builtin C type is 32 bits wide" >&5 fi ! echo "$ac_t""$bash_cv_type_int32_t" 1>&6; ! if test "$bash_cv_type_int32_t" = "int"; then ! cat >> confdefs.h <<\EOF #define int32_t int EOF else ! cat >> confdefs.h <<\EOF ! #define int32_t long EOF fi fi ! echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6 ! echo "configure:4045: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 4082,4203 ---- if test $ac_cv_type_int32_t = no; then cat >> confdefs.h <<\EOF ! #define int32_t int EOF fi ! elif test "$ac_cv_sizeof_long" = 4; then ! echo $ac_n "checking for int32_t""... $ac_c" 1>&6 ! echo "configure:4092: checking for int32_t" >&5 ! if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < ! #if STDC_HEADERS ! #include ! #include #endif EOF ! if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ! egrep "int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then ! rm -rf conftest* ! ac_cv_type_int32_t=yes else ! rm -rf conftest* ! ac_cv_type_int32_t=no fi ! rm -f conftest* ! fi + echo "$ac_t""$ac_cv_type_int32_t" 1>&6 + if test $ac_cv_type_int32_t = no; then + cat >> confdefs.h <<\EOF + #define int32_t long + EOF fi ! else ! echo $ac_n "checking for int32_t""... $ac_c" 1>&6 ! echo "configure:4126: checking for int32_t" >&5 ! if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < ! #if STDC_HEADERS ! #include ! #include ! #endif ! EOF ! if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ! egrep "int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then ! rm -rf conftest* ! ac_cv_type_int32_t=yes ! else ! rm -rf conftest* ! ac_cv_type_int32_t=no fi ! rm -f conftest* ! ! fi ! echo "$ac_t""$ac_cv_type_int32_t" 1>&6 ! if test $ac_cv_type_int32_t = no; then ! cat >> confdefs.h <<\EOF #define int32_t int EOF + fi + + fi + + + if test "$ac_cv_sizeof_int" = 4; then + echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6 + echo "configure:4163: checking for u_int32_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else ! cat > conftest.$ac_ext < ! #if STDC_HEADERS ! #include ! #include ! #endif EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "u_int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_u_int32_t=yes + else + rm -rf conftest* + ac_cv_type_u_int32_t=no + fi + rm -f conftest* fi + echo "$ac_t""$ac_cv_type_u_int32_t" 1>&6 + if test $ac_cv_type_u_int32_t = no; then + cat >> confdefs.h <<\EOF + #define u_int32_t unsigned int + EOF fi ! ! elif test "$ac_cv_sizeof_long" = 4; then ! echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6 ! echo "configure:4197: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 4069,4151 **** if test $ac_cv_type_u_int32_t = no; then cat >> confdefs.h <<\EOF ! #define u_int32_t EOF fi - if test "$ac_cv_type_u_int32_t" = "no"; then - - if test "X$bash_cv_type_u_int32_t" = "X"; then - _bash_needmsg=yes else ! echo $ac_n "checking which unsigned builtin C type is 32 bits wide""... $ac_c" 1>&6 ! echo "configure:4083: checking which unsigned builtin C type is 32 bits wide" >&5 ! _bash_needmsg= ! fi ! if eval "test \"`echo '$''{'bash_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test "$cross_compiling" = yes; then - { echo "configure: error: cannot check type sizes if cross-compiling -- defaulting to int" 1>&2; exit 1; } - bash_cv_type_u_int32_t=int - - else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null ! then ! bash_cv_type_u_int32_t=int else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -fr conftest* ! bash_cv_type_u_int32_t=long fi ! rm -fr conftest* fi fi - if test "X$_bash_needmsg" = "Xyes"; then - echo $ac_n "checking which unsigned builtin C type is 32 bits wide""... $ac_c" 1>&6 - echo "configure:4127: checking which unsigned builtin C type is 32 bits wide" >&5 fi - echo "$ac_t""$bash_cv_type_u_int32_t" 1>&6; - if test "$bash_cv_type_u_int32_t" = "int"; then - cat >> confdefs.h <<\EOF - #define u_int32_t unsigned int - EOF else ! cat >> confdefs.h <<\EOF ! #define u_int32_t unsigned long EOF fi fi ! echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6 ! echo "configure:4145: checking for ptrdiff_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ptrdiff_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 4221,4308 ---- if test $ac_cv_type_u_int32_t = no; then cat >> confdefs.h <<\EOF ! #define u_int32_t unsigned long EOF fi else ! echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6 ! echo "configure:4231: checking for u_int32_t" >&5 ! if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < ! #if STDC_HEADERS ! #include ! #include #endif EOF ! if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ! egrep "u_int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then ! rm -rf conftest* ! ac_cv_type_u_int32_t=yes else ! rm -rf conftest* ! ac_cv_type_u_int32_t=no fi ! rm -f conftest* ! fi + echo "$ac_t""$ac_cv_type_u_int32_t" 1>&6 + if test $ac_cv_type_u_int32_t = no; then + cat >> confdefs.h <<\EOF + #define u_int32_t unsigned int + EOF fi fi + + if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then + echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6 + echo "configure:4268: checking for ptrdiff_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_ptrdiff_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else ! cat > conftest.$ac_ext < ! #if STDC_HEADERS ! #include ! #include ! #endif EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "ptrdiff_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_ptrdiff_t=yes + else + rm -rf conftest* + ac_cv_type_ptrdiff_t=no + fi + rm -f conftest* fi + echo "$ac_t""$ac_cv_type_ptrdiff_t" 1>&6 + if test $ac_cv_type_ptrdiff_t = no; then + cat >> confdefs.h <<\EOF + #define ptrdiff_t int + EOF fi ! elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then ! echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6 ! echo "configure:4302: checking for ptrdiff_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ptrdiff_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 4169,4238 **** if test $ac_cv_type_ptrdiff_t = no; then cat >> confdefs.h <<\EOF ! #define ptrdiff_t EOF fi - if test "$ac_cv_type_ptrdiff_t" = "no"; then - - if test "X$bash_cv_type_ptrdiff_t" = "X"; then - _bash_needmsg=yes else ! echo $ac_n "checking which builtin C type is correct for ptrdiff_t""... $ac_c" 1>&6 ! echo "configure:4183: checking which builtin C type is correct for ptrdiff_t" >&5 ! _bash_needmsg= ! fi ! if eval "test \"`echo '$''{'bash_cv_type_ptrdiff_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check type sizes if cross-compiling -- defaulting to int" 1>&2; exit 1; } ! bash_cv_type_ptrdiff_t=int else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null ! then ! bash_cv_type_ptrdiff_t=int else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -fr conftest* ! bash_cv_type_ptrdiff_t=long fi ! rm -fr conftest* fi fi ! if test "X$_bash_needmsg" = "Xyes"; then ! echo $ac_n "checking which builtin C type is correct for ptrdiff_t""... $ac_c" 1>&6 ! echo "configure:4227: checking which builtin C type is correct for ptrdiff_t" >&5 fi ! echo "$ac_t""$bash_cv_type_ptrdiff_t" 1>&6; ! if test "$bash_cv_type_ptrdiff_t" = "int"; then ! cat >> confdefs.h <<\EOF ! #define ptrdiff_t int EOF else ! cat >> confdefs.h <<\EOF ! #define ptrdiff_t long EOF --- 4326,4503 ---- if test $ac_cv_type_ptrdiff_t = no; then cat >> confdefs.h <<\EOF ! #define ptrdiff_t long EOF fi else ! echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6 ! echo "configure:4336: checking for ptrdiff_t" >&5 ! if eval "test \"`echo '$''{'ac_cv_type_ptrdiff_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! cat > conftest.$ac_ext < ! #if STDC_HEADERS ! #include ! #include ! #endif ! EOF ! if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ! egrep "ptrdiff_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then ! rm -rf conftest* ! ac_cv_type_ptrdiff_t=yes ! else ! rm -rf conftest* ! ac_cv_type_ptrdiff_t=no ! fi ! rm -f conftest* ! ! fi ! echo "$ac_t""$ac_cv_type_ptrdiff_t" 1>&6 ! if test $ac_cv_type_ptrdiff_t = no; then ! cat >> confdefs.h <<\EOF ! #define ptrdiff_t int ! EOF + fi + + fi + + + if test "$ac_sv_sizeof_char_p" = 8; then + echo $ac_n "checking for bits64_t""... $ac_c" 1>&6 + echo "configure:4373: checking for bits64_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_bits64_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < + #if STDC_HEADERS + #include + #include + #endif + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "bits64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_bits64_t=yes + else + rm -rf conftest* + ac_cv_type_bits64_t=no + fi + rm -f conftest* ! fi ! echo "$ac_t""$ac_cv_type_bits64_t" 1>&6 ! if test $ac_cv_type_bits64_t = no; then ! cat >> confdefs.h <<\EOF ! #define bits64_t char * ! EOF ! ! fi ! ! elif test "$ac_cv_sizeof_double" = 8; then ! echo $ac_n "checking for bits64_t""... $ac_c" 1>&6 ! echo "configure:4407: checking for bits64_t" >&5 ! if eval "test \"`echo '$''{'ac_cv_type_bits64_t'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < ! #if STDC_HEADERS ! #include ! #include #endif EOF ! if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ! egrep "bits64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then ! rm -rf conftest* ! ac_cv_type_bits64_t=yes else ! rm -rf conftest* ! ac_cv_type_bits64_t=no fi ! rm -f conftest* ! fi + echo "$ac_t""$ac_cv_type_bits64_t" 1>&6 + if test $ac_cv_type_bits64_t = no; then + cat >> confdefs.h <<\EOF + #define bits64_t double + EOF fi ! elif test "$ac_cv_sizeof_long" = 8; then ! echo $ac_n "checking for bits64_t""... $ac_c" 1>&6 ! echo "configure:4441: checking for bits64_t" >&5 ! if eval "test \"`echo '$''{'ac_cv_type_bits64_t'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < ! #if STDC_HEADERS ! #include ! #include ! #endif ! EOF ! if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ! egrep "bits64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then ! rm -rf conftest* ! ac_cv_type_bits64_t=yes ! else ! rm -rf conftest* ! ac_cv_type_bits64_t=no fi ! rm -f conftest* ! ! fi ! echo "$ac_t""$ac_cv_type_bits64_t" 1>&6 ! if test $ac_cv_type_bits64_t = no; then ! cat >> confdefs.h <<\EOF ! #define bits64_t long EOF + fi + else ! echo $ac_n "checking for bits64_t""... $ac_c" 1>&6 ! echo "configure:4475: checking for bits64_t" >&5 ! if eval "test \"`echo '$''{'ac_cv_type_bits64_t'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < ! #if STDC_HEADERS ! #include ! #include ! #endif ! EOF ! if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ! egrep "bits64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then ! rm -rf conftest* ! ac_cv_type_bits64_t=yes ! else ! rm -rf conftest* ! ac_cv_type_bits64_t=no ! fi ! rm -f conftest* ! ! fi ! echo "$ac_t""$ac_cv_type_bits64_t" 1>&6 ! if test $ac_cv_type_bits64_t = no; then ! cat >> confdefs.h <<\EOF ! #define bits64_t double EOF *************** *** 4241,4251 **** fi echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 ! echo "configure:4245: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 4506,4517 ---- fi + echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 ! echo "configure:4511: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 4298,4302 **** cat > conftest.$ac_ext < --- 4564,4568 ---- cat > conftest.$ac_ext < *************** *** 4311,4315 **** if test -z "$bash_cv_struct_timeval"; then cat > conftest.$ac_ext < --- 4577,4581 ---- if test -z "$bash_cv_struct_timeval"; then cat > conftest.$ac_ext < *************** *** 4334,4338 **** echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 ! echo "configure:4337: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 4600,4604 ---- echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 ! echo "configure:4603: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 4341,4345 **** # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < --- 4607,4611 ---- # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < *************** *** 4352,4360 **** ; return 0; } EOF ! if { (eval echo configure:4355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < --- 4618,4626 ---- ; return 0; } EOF ! if { (eval echo configure:4621: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < *************** *** 4367,4371 **** ; return 0; } EOF ! if { (eval echo configure:4370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes --- 4633,4637 ---- ; return 0; } EOF ! if { (eval echo configure:4636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes *************** *** 4387,4391 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no --- 4666,4670 ---- } EOF ! if { (eval echo configure:4669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no *************** *** 4427,4431 **** ac_msg="whether #! works in shell scripts" echo $ac_n "checking $ac_msg""... $ac_c" 1>&6 ! echo "configure:4430: checking $ac_msg" >&5 if eval "test \"`echo '$''{'ac_cv_sys_interpreter'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 4693,4697 ---- ac_msg="whether #! works in shell scripts" echo $ac_n "checking $ac_msg""... $ac_c" 1>&6 ! echo "configure:4696: checking $ac_msg" >&5 if eval "test \"`echo '$''{'ac_cv_sys_interpreter'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 4453,4457 **** fi echo $ac_n "checking for restartable system calls""... $ac_c" 1>&6 ! echo "configure:4456: checking for restartable system calls" >&5 if eval "test \"`echo '$''{'ac_cv_sys_restartable_syscalls'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 4719,4723 ---- fi echo $ac_n "checking for restartable system calls""... $ac_c" 1>&6 ! echo "configure:4722: checking for restartable system calls" >&5 if eval "test \"`echo '$''{'ac_cv_sys_restartable_syscalls'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 4461,4465 **** else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sys_restartable_syscalls=yes --- 4745,4749 ---- EOF ! if { (eval echo configure:4748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sys_restartable_syscalls=yes *************** *** 4504,4513 **** if test "$ac_cv_func_lstat" = "no"; then echo $ac_n "checking for lstat""... $ac_c" 1>&6 ! echo "configure:4507: checking for lstat" >&5 if eval "test \"`echo '$''{'bash_cv_func_lstat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:4773: checking for lstat" >&5 if eval "test \"`echo '$''{'bash_cv_func_lstat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_func_lstat=yes --- 4785,4789 ---- ; return 0; } EOF ! if { (eval echo configure:4788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_func_lstat=yes *************** *** 4542,4555 **** echo $ac_n "checking if dup2 fails to clear the close-on-exec flag""... $ac_c" 1>&6 ! echo "configure:4545: checking if dup2 fails to clear the close-on-exec flag" >&5 if eval "test \"`echo '$''{'bash_cv_dup2_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check dup2 if cross compiling -- defaulting to no" 1>&2; exit 1; } bash_cv_dup2_broken=no else cat > conftest.$ac_ext <&6 ! echo "configure:4811: checking if dup2 fails to clear the close-on-exec flag" >&5 if eval "test \"`echo '$''{'bash_cv_dup2_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check dup2 if cross compiling -- defaulting to no" 1>&2 bash_cv_dup2_broken=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_dup2_broken=yes --- 4837,4841 ---- EOF ! if { (eval echo configure:4840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_dup2_broken=yes *************** *** 4596,4609 **** echo $ac_n "checking whether pgrps need synchronization""... $ac_c" 1>&6 ! echo "configure:4599: checking whether pgrps need synchronization" >&5 if eval "test \"`echo '$''{'bash_cv_pgrp_pipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check pgrp synchronization if cross compiling -- defaulting to no" 1>&2; exit 1; } bash_cv_pgrp_pipe=no else cat > conftest.$ac_ext <&6 ! echo "configure:4865: checking whether pgrps need synchronization" >&5 if eval "test \"`echo '$''{'bash_cv_pgrp_pipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check pgrp synchronization if cross compiling -- defaulting to no" 1>&2 bash_cv_pgrp_pipe=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_pgrp_pipe=no --- 4923,4927 ---- EOF ! if { (eval echo configure:4926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_pgrp_pipe=no *************** *** 4682,4686 **** echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6 ! echo "configure:4685: checking for type of signal functions" >&5 if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 4948,4952 ---- echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6 ! echo "configure:4951: checking for type of signal functions" >&5 if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 4688,4692 **** cat > conftest.$ac_ext < --- 4954,4958 ---- cat > conftest.$ac_ext < *************** *** 4701,4705 **** ; return 0; } EOF ! if { (eval echo configure:4704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_signal_vintage=posix --- 4967,4971 ---- ; return 0; } EOF ! if { (eval echo configure:4970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_signal_vintage=posix *************** *** 4710,4714 **** cat > conftest.$ac_ext < --- 4976,4980 ---- cat > conftest.$ac_ext < *************** *** 4720,4724 **** ; return 0; } EOF ! if { (eval echo configure:4723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_signal_vintage=4.2bsd --- 4986,4990 ---- ; return 0; } EOF ! if { (eval echo configure:4989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_signal_vintage=4.2bsd *************** *** 4729,4733 **** cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_signal_vintage=svr3 --- 5008,5012 ---- ; return 0; } EOF ! if { (eval echo configure:5011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_signal_vintage=svr3 *************** *** 4784,4796 **** echo $ac_n "checking for restartable system calls with posix sigaction""... $ac_c" 1>&6 ! echo "configure:4787: checking for restartable system calls with posix sigaction" >&5 if eval "test \"`echo '$''{'bash_cv_sys_restartable_syscalls'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check restartable syscalls if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&6 ! echo "configure:5053: checking for restartable system calls with posix sigaction" >&5 if eval "test \"`echo '$''{'bash_cv_sys_restartable_syscalls'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check restartable syscalls if cross compiling" 1>&2 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_sys_restartable_syscalls=yes --- 5092,5096 ---- EOF ! if { (eval echo configure:5095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_sys_restartable_syscalls=yes *************** *** 4852,4861 **** echo $ac_n "checking for sys_errlist and sys_nerr""... $ac_c" 1>&6 ! echo "configure:4855: checking for sys_errlist and sys_nerr" >&5 if eval "test \"`echo '$''{'bash_cv_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5118,5127 ---- echo $ac_n "checking for sys_errlist and sys_nerr""... $ac_c" 1>&6 ! echo "configure:5121: checking for sys_errlist and sys_nerr" >&5 if eval "test \"`echo '$''{'bash_cv_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 4866,4870 **** ; return 0; } EOF ! if { (eval echo configure:4869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_sys_errlist=yes --- 5132,5136 ---- ; return 0; } EOF ! if { (eval echo configure:5135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_sys_errlist=yes *************** *** 4887,4900 **** echo $ac_n "checking for sys_siglist in system C library""... $ac_c" 1>&6 ! echo "configure:4890: checking for sys_siglist in system C library" >&5 if eval "test \"`echo '$''{'bash_cv_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check for sys_siglist if cross compiling -- defaulting to no" 1>&2; exit 1; } bash_cv_sys_siglist=no else cat > conftest.$ac_ext <&6 ! echo "configure:5156: checking for sys_siglist in system C library" >&5 if eval "test \"`echo '$''{'bash_cv_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check for sys_siglist if cross compiling -- defaulting to no" 1>&2 bash_cv_sys_siglist=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_sys_siglist=yes --- 5179,5183 ---- } EOF ! if { (eval echo configure:5182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_sys_siglist=yes *************** *** 4936,4945 **** echo $ac_n "checking for _sys_siglist in signal.h or unistd.h""... $ac_c" 1>&6 ! echo "configure:4939: checking for _sys_siglist in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'bash_cv_decl_under_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:5205: checking for _sys_siglist in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'bash_cv_decl_under_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_decl_under_sys_siglist=yes --- 5219,5223 ---- ; return 0; } EOF ! if { (eval echo configure:5222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_decl_under_sys_siglist=yes *************** *** 4974,4987 **** echo $ac_n "checking for _sys_siglist in system C library""... $ac_c" 1>&6 ! echo "configure:4977: checking for _sys_siglist in system C library" >&5 if eval "test \"`echo '$''{'bash_cv_under_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check for _sys_siglist if cross compiling -- defaulting to no" 1>&2; exit 1; } bash_cv_under_sys_siglist=no else cat > conftest.$ac_ext <&6 ! echo "configure:5243: checking for _sys_siglist in system C library" >&5 if eval "test \"`echo '$''{'bash_cv_under_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check for _sys_siglist if cross compiling -- defaulting to no" 1>&2 bash_cv_under_sys_siglist=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_under_sys_siglist=yes --- 5266,5270 ---- } EOF ! if { (eval echo configure:5269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_under_sys_siglist=yes *************** *** 5024,5033 **** echo $ac_n "checking whether signal handlers are of type void""... $ac_c" 1>&6 ! echo "configure:5027: checking whether signal handlers are of type void" >&5 if eval "test \"`echo '$''{'bash_cv_void_sighandler'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5290,5299 ---- echo $ac_n "checking whether signal handlers are of type void""... $ac_c" 1>&6 ! echo "configure:5293: checking whether signal handlers are of type void" >&5 if eval "test \"`echo '$''{'bash_cv_void_sighandler'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5044,5048 **** ; return 0; } EOF ! if { (eval echo configure:5047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_void_sighandler=yes --- 5310,5314 ---- ; return 0; } EOF ! if { (eval echo configure:5313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_void_sighandler=yes *************** *** 5064,5073 **** echo $ac_n "checking for clock_t""... $ac_c" 1>&6 ! echo "configure:5067: checking for clock_t" >&5 if eval "test \"`echo '$''{'bash_cv_type_clock_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5330,5339 ---- echo $ac_n "checking for clock_t""... $ac_c" 1>&6 ! echo "configure:5333: checking for clock_t" >&5 if eval "test \"`echo '$''{'bash_cv_type_clock_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5100,5109 **** echo $ac_n "checking for sigset_t""... $ac_c" 1>&6 ! echo "configure:5103: checking for sigset_t" >&5 if eval "test \"`echo '$''{'bash_cv_type_sigset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5366,5375 ---- echo $ac_n "checking for sigset_t""... $ac_c" 1>&6 ! echo "configure:5369: checking for sigset_t" >&5 if eval "test \"`echo '$''{'bash_cv_type_sigset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5136,5145 **** echo $ac_n "checking for quad_t""... $ac_c" 1>&6 ! echo "configure:5139: checking for quad_t" >&5 if eval "test \"`echo '$''{'bash_cv_type_quad_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5402,5411 ---- echo $ac_n "checking for quad_t""... $ac_c" 1>&6 ! echo "configure:5405: checking for quad_t" >&5 if eval "test \"`echo '$''{'bash_cv_type_quad_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5177,5186 **** echo $ac_n "checking for size and type of struct rlimit fields""... $ac_c" 1>&6 ! echo "configure:5180: checking for size and type of struct rlimit fields" >&5 if eval "test \"`echo '$''{'bash_cv_type_rlimit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5443,5452 ---- echo $ac_n "checking for size and type of struct rlimit fields""... $ac_c" 1>&6 ! echo "configure:5446: checking for size and type of struct rlimit fields" >&5 if eval "test \"`echo '$''{'bash_cv_type_rlimit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5190,5194 **** ; return 0; } EOF ! if { (eval echo configure:5193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_type_rlimit=rlim_t --- 5456,5460 ---- ; return 0; } EOF ! if { (eval echo configure:5459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_type_rlimit=rlim_t *************** *** 5199,5207 **** if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check quad_t if cross compiling -- defaulting to long" 1>&2; exit 1; } bash_cv_type_rlimit=long else cat > conftest.$ac_ext <&2 bash_cv_type_rlimit=long else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_type_rlimit=quad_t --- 5485,5489 ---- } EOF ! if { (eval echo configure:5488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_type_rlimit=quad_t *************** *** 5251,5260 **** echo $ac_n "checking for a c_line member of struct termios""... $ac_c" 1>&6 ! echo "configure:5254: checking for a c_line member of struct termios" >&5 if eval "test \"`echo '$''{'bash_cv_termios_ldisc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5517,5526 ---- echo $ac_n "checking for a c_line member of struct termios""... $ac_c" 1>&6 ! echo "configure:5520: checking for a c_line member of struct termios" >&5 if eval "test \"`echo '$''{'bash_cv_termios_ldisc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5264,5268 **** ; return 0; } EOF ! if { (eval echo configure:5267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_termios_ldisc=yes --- 5530,5534 ---- ; return 0; } EOF ! if { (eval echo configure:5533: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_termios_ldisc=yes *************** *** 5284,5293 **** echo $ac_n "checking for a c_line member of struct termio""... $ac_c" 1>&6 ! echo "configure:5287: checking for a c_line member of struct termio" >&5 if eval "test \"`echo '$''{'bash_cv_termio_ldisc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5550,5559 ---- echo $ac_n "checking for a c_line member of struct termio""... $ac_c" 1>&6 ! echo "configure:5553: checking for a c_line member of struct termio" >&5 if eval "test \"`echo '$''{'bash_cv_termio_ldisc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5297,5301 **** ; return 0; } EOF ! if { (eval echo configure:5300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_termio_ldisc=yes --- 5563,5567 ---- ; return 0; } EOF ! if { (eval echo configure:5566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_termio_ldisc=yes *************** *** 5318,5327 **** echo $ac_n "checking if struct dirent has a d_ino member""... $ac_c" 1>&6 ! echo "configure:5321: checking if struct dirent has a d_ino member" >&5 if eval "test \"`echo '$''{'bash_cv_dirent_has_dino'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:5587: checking if struct dirent has a d_ino member" >&5 if eval "test \"`echo '$''{'bash_cv_dirent_has_dino'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_dirent_has_dino=yes --- 5618,5622 ---- ; return 0; } EOF ! if { (eval echo configure:5621: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_dirent_has_dino=yes *************** *** 5374,5383 **** echo $ac_n "checking if struct dirent has a d_fileno member""... $ac_c" 1>&6 ! echo "configure:5377: checking if struct dirent has a d_fileno member" >&5 if eval "test \"`echo '$''{'bash_cv_dirent_has_d_fileno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:5643: checking if struct dirent has a d_fileno member" >&5 if eval "test \"`echo '$''{'bash_cv_dirent_has_d_fileno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_dirent_has_d_fileno=yes --- 5674,5678 ---- ; return 0; } EOF ! if { (eval echo configure:5677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_dirent_has_d_fileno=yes *************** *** 5429,5438 **** echo $ac_n "checking for struct winsize in sys/ioctl.h and termios.h""... $ac_c" 1>&6 ! echo "configure:5432: checking for struct winsize in sys/ioctl.h and termios.h" >&5 if eval "test \"`echo '$''{'bash_cv_struct_winsize_header'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5695,5704 ---- echo $ac_n "checking for struct winsize in sys/ioctl.h and termios.h""... $ac_c" 1>&6 ! echo "configure:5698: checking for struct winsize in sys/ioctl.h and termios.h" >&5 if eval "test \"`echo '$''{'bash_cv_struct_winsize_header'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5442,5446 **** ; return 0; } EOF ! if { (eval echo configure:5445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_struct_winsize_header=ioctl_h --- 5708,5712 ---- ; return 0; } EOF ! if { (eval echo configure:5711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_struct_winsize_header=ioctl_h *************** *** 5450,5454 **** rm -rf conftest* cat > conftest.$ac_ext < --- 5716,5720 ---- rm -rf conftest* cat > conftest.$ac_ext < *************** *** 5458,5462 **** ; return 0; } EOF ! if { (eval echo configure:5461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_struct_winsize_header=termios_h --- 5724,5728 ---- ; return 0; } EOF ! if { (eval echo configure:5727: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_struct_winsize_header=termios_h *************** *** 5491,5500 **** echo $ac_n "checking for the existence of strsignal""... $ac_c" 1>&6 ! echo "configure:5494: checking for the existence of strsignal" >&5 if eval "test \"`echo '$''{'bash_cv_have_strsignal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 5757,5766 ---- echo $ac_n "checking for the existence of strsignal""... $ac_c" 1>&6 ! echo "configure:5760: checking for the existence of strsignal" >&5 if eval "test \"`echo '$''{'bash_cv_have_strsignal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5504,5508 **** ; return 0; } EOF ! if { (eval echo configure:5507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_have_strsignal=yes --- 5770,5774 ---- ; return 0; } EOF ! if { (eval echo configure:5773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* bash_cv_have_strsignal=yes *************** *** 5525,5539 **** echo $ac_n "checking if opendir() opens non-directories""... $ac_c" 1>&6 ! echo "configure:5528: checking if opendir() opens non-directories" >&5 if eval "test \"`echo '$''{'bash_cv_opendir_not_robust'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check opendir if cross compiling -- defaulting to no" 1>&2; exit 1; } bash_cv_opendir_not_robust=no else cat > conftest.$ac_ext <&6 ! echo "configure:5794: checking if opendir() opens non-directories" >&5 if eval "test \"`echo '$''{'bash_cv_opendir_not_robust'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check opendir if cross compiling -- defaulting to no" 1>&2 bash_cv_opendir_not_robust=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_opendir_not_robust=yes --- 5837,5841 ---- } EOF ! if { (eval echo configure:5840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_opendir_not_robust=yes *************** *** 5594,5608 **** echo $ac_n "checking for declaration of printf in ""... $ac_c" 1>&6 ! echo "configure:5597: checking for declaration of printf in " >&5 if eval "test \"`echo '$''{'bash_cv_printf_declared'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check printf declaration if cross compiling -- defaulting to yes" 1>&2; exit 1; } bash_cv_printf_declared=yes else cat > conftest.$ac_ext <""... $ac_c" 1>&6 ! echo "configure:5863: checking for declaration of printf in " >&5 if eval "test \"`echo '$''{'bash_cv_printf_declared'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check printf declaration if cross compiling -- defaulting to yes" 1>&2 bash_cv_printf_declared=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_printf_declared=yes --- 5887,5891 ---- EOF ! if { (eval echo configure:5890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_printf_declared=yes *************** *** 5644,5658 **** echo $ac_n "checking whether ulimit can substitute for getdtablesize""... $ac_c" 1>&6 ! echo "configure:5647: checking whether ulimit can substitute for getdtablesize" >&5 if eval "test \"`echo '$''{'bash_cv_ulimit_maxfds'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check ulimit if cross compiling -- defaulting to no" 1>&2; exit 1; } bash_cv_ulimit_maxfds=no else cat > conftest.$ac_ext <&6 ! echo "configure:5913: checking whether ulimit can substitute for getdtablesize" >&5 if eval "test \"`echo '$''{'bash_cv_ulimit_maxfds'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check ulimit if cross compiling -- defaulting to no" 1>&2 bash_cv_ulimit_maxfds=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_ulimit_maxfds=yes --- 5930,5934 ---- EOF ! if { (eval echo configure:5933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_ulimit_maxfds=yes *************** *** 5687,5701 **** echo $ac_n "checking to see if getenv can be redefined""... $ac_c" 1>&6 ! echo "configure:5690: checking to see if getenv can be redefined" >&5 if eval "test \"`echo '$''{'bash_cv_getenv_redef'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check getenv redefinition if cross compiling -- defaulting to yes" 1>&2; exit 1; } bash_cv_getenv_redef=yes else cat > conftest.$ac_ext <&6 ! echo "configure:5956: checking to see if getenv can be redefined" >&5 if eval "test \"`echo '$''{'bash_cv_getenv_redef'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check getenv redefinition if cross compiling -- defaulting to yes" 1>&2 bash_cv_getenv_redef=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_getenv_redef=yes --- 5998,6002 ---- EOF ! if { (eval echo configure:6001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_getenv_redef=yes *************** *** 5755,5769 **** echo $ac_n "checking if getcwd() calls popen()""... $ac_c" 1>&6 ! echo "configure:5758: checking if getcwd() calls popen()" >&5 if eval "test \"`echo '$''{'bash_cv_getcwd_calls_popen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check whether getcwd calls popen if cross compiling -- defaulting to no" 1>&2; exit 1; } bash_cv_getcwd_calls_popen=no else cat > conftest.$ac_ext <&6 ! echo "configure:6024: checking if getcwd() calls popen()" >&5 if eval "test \"`echo '$''{'bash_cv_getcwd_calls_popen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check whether getcwd calls popen if cross compiling -- defaulting to no" 1>&2 bash_cv_getcwd_calls_popen=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_getcwd_calls_popen=no --- 6086,6090 ---- EOF ! if { (eval echo configure:6089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_getcwd_calls_popen=no *************** *** 5843,5852 **** echo $ac_n "checking for declaration of sbrk in ""... $ac_c" 1>&6 ! echo "configure:5846: checking for declaration of sbrk in " >&5 if eval "test \"`echo '$''{'bash_cv_sbrk_declared'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 6109,6118 ---- echo $ac_n "checking for declaration of sbrk in ""... $ac_c" 1>&6 ! echo "configure:6112: checking for declaration of sbrk in " >&5 if eval "test \"`echo '$''{'bash_cv_sbrk_declared'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 5874,5888 **** echo $ac_n "checking for presence of POSIX-style sigsetjmp/siglongjmp""... $ac_c" 1>&6 ! echo "configure:5877: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5 if eval "test \"`echo '$''{'bash_cv_func_sigsetjmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing" 1>&2; exit 1; } bash_cv_func_sigsetjmp=missing else cat > conftest.$ac_ext <&6 ! echo "configure:6143: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5 if eval "test \"`echo '$''{'bash_cv_func_sigsetjmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing" 1>&2 bash_cv_func_sigsetjmp=missing else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_func_sigsetjmp=present --- 6191,6195 ---- } EOF ! if { (eval echo configure:6194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_func_sigsetjmp=present *************** *** 5949,5963 **** echo $ac_n "checking whether or not strcoll and strcmp differ""... $ac_c" 1>&6 ! echo "configure:5952: checking whether or not strcoll and strcmp differ" >&5 if eval "test \"`echo '$''{'bash_cv_func_strcoll_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check strcoll if cross compiling -- defaulting to no" 1>&2; exit 1; } bash_cv_func_strcoll_broken=no else cat > conftest.$ac_ext <&6 ! echo "configure:6218: checking whether or not strcoll and strcmp differ" >&5 if eval "test \"`echo '$''{'bash_cv_func_strcoll_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check strcoll if cross compiling -- defaulting to no" 1>&2 bash_cv_func_strcoll_broken=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_func_strcoll_broken=yes --- 6264,6268 ---- EOF ! if { (eval echo configure:6267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_func_strcoll_broken=yes *************** *** 6024,6038 **** echo $ac_n "checking if signal handlers must be reinstalled when invoked""... $ac_c" 1>&6 ! echo "configure:6027: checking if signal handlers must be reinstalled when invoked" >&5 if eval "test \"`echo '$''{'bash_cv_must_reinstall_sighandlers'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check signal handling if cross compiling -- defaulting to no" 1>&2; exit 1; } bash_cv_must_reinstall_sighandlers=no else cat > conftest.$ac_ext <&6 ! echo "configure:6293: checking if signal handlers must be reinstalled when invoked" >&5 if eval "test \"`echo '$''{'bash_cv_must_reinstall_sighandlers'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check signal handling if cross compiling -- defaulting to no" 1>&2 bash_cv_must_reinstall_sighandlers=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_must_reinstall_sighandlers=no --- 6347,6351 ---- EOF ! if { (eval echo configure:6350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_must_reinstall_sighandlers=no *************** *** 6105,6119 **** echo $ac_n "checking for presence of necessary job control definitions""... $ac_c" 1>&6 ! echo "configure:6108: checking for presence of necessary job control definitions" >&5 if eval "test \"`echo '$''{'bash_cv_job_control_missing'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check job control if cross-compiling -- defaulting to missing" 1>&2; exit 1; } bash_cv_job_control_missing=missing else cat > conftest.$ac_ext <&6 ! echo "configure:6374: checking for presence of necessary job control definitions" >&5 if eval "test \"`echo '$''{'bash_cv_job_control_missing'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check job control if cross-compiling -- defaulting to missing" 1>&2 bash_cv_job_control_missing=missing else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_job_control_missing=present --- 6428,6432 ---- } EOF ! if { (eval echo configure:6431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_job_control_missing=present *************** *** 6185,6199 **** echo $ac_n "checking for presence of named pipes""... $ac_c" 1>&6 ! echo "configure:6188: checking for presence of named pipes" >&5 if eval "test \"`echo '$''{'bash_cv_sys_named_pipes'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: cannot check for named pipes if cross-compiling -- defaulting to missing" 1>&2; exit 1; } bash_cv_sys_named_pipes=missing else cat > conftest.$ac_ext <&6 ! echo "configure:6454: checking for presence of named pipes" >&5 if eval "test \"`echo '$''{'bash_cv_sys_named_pipes'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! echo "configure: warning: cannot check for named pipes if cross-compiling -- defaulting to missing" 1>&2 bash_cv_sys_named_pipes=missing else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_sys_named_pipes=present --- 6495,6499 ---- } EOF ! if { (eval echo configure:6498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then bash_cv_sys_named_pipes=present *************** *** 6253,6262 **** echo $ac_n "checking for TIOCGWINSZ in sys/ioctl.h""... $ac_c" 1>&6 ! echo "configure:6256: checking for TIOCGWINSZ in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_tiocgwinsz_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 6519,6528 ---- echo $ac_n "checking for TIOCGWINSZ in sys/ioctl.h""... $ac_c" 1>&6 ! echo "configure:6522: checking for TIOCGWINSZ in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_tiocgwinsz_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 6266,6270 **** ; return 0; } EOF ! if { (eval echo configure:6269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_tiocgwinsz_in_ioctl=yes --- 6532,6536 ---- ; return 0; } EOF ! if { (eval echo configure:6535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_tiocgwinsz_in_ioctl=yes *************** *** 6287,6296 **** echo $ac_n "checking for TIOCSTAT in sys/ioctl.h""... $ac_c" 1>&6 ! echo "configure:6290: checking for TIOCSTAT in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_tiocstat_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 6553,6562 ---- echo $ac_n "checking for TIOCSTAT in sys/ioctl.h""... $ac_c" 1>&6 ! echo "configure:6556: checking for TIOCSTAT in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_tiocstat_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 6300,6304 **** ; return 0; } EOF ! if { (eval echo configure:6303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_tiocstat_in_ioctl=yes --- 6566,6570 ---- ; return 0; } EOF ! if { (eval echo configure:6569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_tiocstat_in_ioctl=yes *************** *** 6321,6330 **** echo $ac_n "checking for FIONREAD in sys/ioctl.h""... $ac_c" 1>&6 ! echo "configure:6324: checking for FIONREAD in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_fionread_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 6587,6596 ---- echo $ac_n "checking for FIONREAD in sys/ioctl.h""... $ac_c" 1>&6 ! echo "configure:6590: checking for FIONREAD in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_fionread_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 6334,6338 **** ; return 0; } EOF ! if { (eval echo configure:6337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_fionread_in_ioctl=yes --- 6600,6604 ---- ; return 0; } EOF ! if { (eval echo configure:6603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_fionread_in_ioctl=yes *************** *** 6356,6365 **** echo $ac_n "checking for speed_t in sys/types.h""... $ac_c" 1>&6 ! echo "configure:6359: checking for speed_t in sys/types.h" >&5 if eval "test \"`echo '$''{'bash_cv_speed_t_in_sys_types'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 6622,6631 ---- echo $ac_n "checking for speed_t in sys/types.h""... $ac_c" 1>&6 ! echo "configure:6625: checking for speed_t in sys/types.h" >&5 if eval "test \"`echo '$''{'bash_cv_speed_t_in_sys_types'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 6368,6372 **** ; return 0; } EOF ! if { (eval echo configure:6371: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_speed_t_in_sys_types=yes --- 6634,6638 ---- ; return 0; } EOF ! if { (eval echo configure:6637: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_speed_t_in_sys_types=yes *************** *** 6389,6398 **** echo $ac_n "checking whether programs are able to redeclare getpw functions""... $ac_c" 1>&6 ! echo "configure:6392: checking whether programs are able to redeclare getpw functions" >&5 if eval "test \"`echo '$''{'bash_cv_can_redecl_getpw'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 6655,6664 ---- echo $ac_n "checking whether programs are able to redeclare getpw functions""... $ac_c" 1>&6 ! echo "configure:6658: checking whether programs are able to redeclare getpw functions" >&5 if eval "test \"`echo '$''{'bash_cv_can_redecl_getpw'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 6405,6409 **** ; return 0; } EOF ! if { (eval echo configure:6408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_can_redecl_getpw=yes --- 6671,6675 ---- ; return 0; } EOF ! if { (eval echo configure:6674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_can_redecl_getpw=yes *************** *** 6428,6437 **** case "$host_os" in hpux*) echo $ac_n "checking whether $host_os needs _KERNEL for RLIMIT defines""... $ac_c" 1>&6 ! echo "configure:6431: checking whether $host_os needs _KERNEL for RLIMIT defines" >&5 if eval "test \"`echo '$''{'bash_cv_kernel_rlimit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:6697: checking whether $host_os needs _KERNEL for RLIMIT defines" >&5 if eval "test \"`echo '$''{'bash_cv_kernel_rlimit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_kernel_rlimit=no --- 6712,6716 ---- ; return 0; } EOF ! if { (eval echo configure:6715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_kernel_rlimit=no *************** *** 6454,6458 **** rm -rf conftest* cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_kernel_rlimit=yes --- 6735,6739 ---- ; return 0; } EOF ! if { (eval echo configure:6738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_kernel_rlimit=yes *************** *** 6503,6507 **** else echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6 ! echo "configure:6506: checking which library has the termcap functions" >&5 _bash_needmsg= fi --- 6769,6773 ---- else echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6 ! echo "configure:6772: checking which library has the termcap functions" >&5 _bash_needmsg= fi *************** *** 6510,6514 **** else echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 ! echo "configure:6513: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 6776,6780 ---- else echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 ! echo "configure:6779: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 6518,6522 **** LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 6795,6799 ---- ; return 0; } EOF ! if { (eval echo configure:6798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 6548,6552 **** echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 ! echo "configure:6551: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 6814,6818 ---- echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 ! echo "configure:6817: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 6556,6560 **** LIBS="-lcurses $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 6833,6837 ---- ; return 0; } EOF ! if { (eval echo configure:6836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 6586,6590 **** echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 ! echo "configure:6589: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 6852,6856 ---- echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 ! echo "configure:6855: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 6594,6598 **** LIBS="-lncurses $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 6871,6875 ---- ; return 0; } EOF ! if { (eval echo configure:6874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 6634,6638 **** if test "X$_bash_needmsg" = "Xyes"; then echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6 ! echo "configure:6637: checking which library has the termcap functions" >&5 fi echo "$ac_t""using $bash_cv_termcap_lib" 1>&6 --- 6900,6904 ---- if test "X$_bash_needmsg" = "Xyes"; then echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6 ! echo "configure:6903: checking which library has the termcap functions" >&5 fi echo "$ac_t""using $bash_cv_termcap_lib" 1>&6 *************** *** 6657,6661 **** echo $ac_n "checking whether /dev/fd is available""... $ac_c" 1>&6 ! echo "configure:6660: checking whether /dev/fd is available" >&5 if eval "test \"`echo '$''{'bash_cv_dev_fd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 6923,6927 ---- echo $ac_n "checking whether /dev/fd is available""... $ac_c" 1>&6 ! echo "configure:6926: checking whether /dev/fd is available" >&5 if eval "test \"`echo '$''{'bash_cv_dev_fd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 6693,6697 **** echo $ac_n "checking for default mail directory""... $ac_c" 1>&6 ! echo "configure:6696: checking for default mail directory" >&5 if eval "test \"`echo '$''{'bash_cv_mail_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 6959,6963 ---- echo $ac_n "checking for default mail directory""... $ac_c" 1>&6 ! echo "configure:6962: checking for default mail directory" >&5 if eval "test \"`echo '$''{'bash_cv_mail_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 6760,6764 **** ! case "$host_os" in sysv4.2*) cat >> confdefs.h <<\EOF #define SVR4_2 1 --- 7026,7030 ---- ! case "${host_os}" in sysv4.2*) cat >> confdefs.h <<\EOF #define SVR4_2 1 *************** *** 6773,6789 **** EOF ;; hpux*) LOCAL_CFLAGS=-DHPUX ;; dgux*) LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;; isc*) LOCAL_CFLAGS=-Disc386;; ! sco3.2v5*) LOCAL_CFLAGS="-DWAITPID_BROKEN -DNO_MEMSCRAMBLE -DPATH_MAX=1024" ;; sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DNO_MEMSCRAMBLE -DPATH_MAX=1024" ;; sco3.2*) LOCAL_CFLAGS=-DMUST_UNBLOCK_CHLD ;; sunos4*) LOCAL_CFLAGS=-DSunOS4 ;; solaris2.5*) LOCAL_CFLAGS=-DSunOS5 ;; linux*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading - aix4.2*) LOCAL_LDFLAGS="-bexpall -brtl" ;;# allow dynamic loading *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s -lunix -lncurses" ;; ! powerux) LOCAL_LIBS="-lgen" ;; cygwin32*) LOCAL_LIBS="-luser32" ;; esac --- 7039,7067 ---- EOF ;; + sysv5*) cat >> confdefs.h <<\EOF + #define SVR5 1 + EOF + ;; + hpux9*) LOCAL_CFLAGS="-DHPUX9 -DHPUX" ;; hpux*) LOCAL_CFLAGS=-DHPUX ;; dgux*) LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;; isc*) LOCAL_CFLAGS=-Disc386;; ! sco3.2v5*) LOCAL_CFLAGS="-b elf -DWAITPID_BROKEN -DNO_MEMSCRAMBLE -DPATH_MAX=1024" ;; sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DNO_MEMSCRAMBLE -DPATH_MAX=1024" ;; sco3.2*) LOCAL_CFLAGS=-DMUST_UNBLOCK_CHLD ;; sunos4*) LOCAL_CFLAGS=-DSunOS4 ;; solaris2.5*) LOCAL_CFLAGS=-DSunOS5 ;; + lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; linux*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s -lunix -lncurses" ;; ! powerux*) LOCAL_LIBS="-lgen" ;; cygwin32*) LOCAL_LIBS="-luser32" ;; + opennt*|interix*) LOCAL_CFLAGS="-DNO_MAIN_ENV_ARG" ;; + esac + + case "${host_os}-${CC}" in + aix4.2*-*gcc*) LOCAL_LDFLAGS="-Xlinker -bexpall -Xlinker -brtl" ;; + aix4.2*) LOCAL_LDFLAGS="-bexpall -brtl" ;; + bsdi4*-*gcc*) LOCAL_LDFLAGS="-rdynamic" ;; # allow dynamic loading, like Linux esac *************** *** 6801,6804 **** --- 7079,7101 ---- esac + # + # Shared object configuration section. These values are generated by + # ${srcdir}/support/shobj-conf + # + if test "$ac_cv_func_dlopen" = "yes" && test -f ${srcdir}/support/shobj-conf + then + echo $ac_n "checking shared object configuration for loadable builtins""... $ac_c" 1>&6 + echo "configure:7089: checking shared object configuration for loadable builtins" >&5 + eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C ${CC} -c ${host_cpu} -o ${host_os} -v ${host_vendor}` + + + + + + + + echo "$ac_t""$SHOBJ_STATUS" 1>&6 + fi + # try to create a directory tree if the source is elsewhere # this should be packaged into a script accessible via ${srcdir}/support *************** *** 6836,6839 **** --- 7133,7138 ---- + + #AC_SUBST(ALLOCA_SOURCE) #AC_SUBST(ALLOCA_OBJECT) *************** *** 6982,6993 **** s%@MALLOC_TARGET@%$MALLOC_TARGET%g s%@MALLOC_SRC@%$MALLOC_SRC%g s%@READLINE_LIB@%$READLINE_LIB%g s%@READLINE_DEP@%$READLINE_DEP%g s%@HISTORY_LIB@%$HISTORY_LIB%g s%@HISTORY_DEP@%$HISTORY_DEP%g ! s%@CC@%$CC%g ! s%@CPP@%$CPP%g ! s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g ! s%@SIGNAMES_H@%$SIGNAMES_H%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g --- 7281,7296 ---- s%@MALLOC_TARGET@%$MALLOC_TARGET%g s%@MALLOC_SRC@%$MALLOC_SRC%g + s%@CC@%$CC%g + s%@CPP@%$CPP%g + s%@SIGNAMES_H@%$SIGNAMES_H%g + s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g + s%@STATIC_LD@%$STATIC_LD%g s%@READLINE_LIB@%$READLINE_LIB%g s%@READLINE_DEP@%$READLINE_DEP%g + s%@RL_LIBDIR@%$RL_LIBDIR%g + s%@RL_INCLUDE@%$RL_INCLUDE%g s%@HISTORY_LIB@%$HISTORY_LIB%g s%@HISTORY_DEP@%$HISTORY_DEP%g ! s%@HIST_LIBDIR@%$HIST_LIBDIR%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g *************** *** 6996,7006 **** --- 7299,7318 ---- s%@YACC@%$YACC%g s%@SET_MAKE@%$SET_MAKE%g + s%@MAKE_SHELL@%$MAKE_SHELL%g s%@ALLOCA@%$ALLOCA%g s%@TERMCAP_LIB@%$TERMCAP_LIB%g s%@TERMCAP_DEP@%$TERMCAP_DEP%g s%@JOBS_O@%$JOBS_O%g + s%@SHOBJ_CC@%$SHOBJ_CC%g + s%@SHOBJ_CFLAGS@%$SHOBJ_CFLAGS%g + s%@SHOBJ_LD@%$SHOBJ_LD%g + s%@SHOBJ_LDFLAGS@%$SHOBJ_LDFLAGS%g + s%@SHOBJ_XLDFLAGS@%$SHOBJ_XLDFLAGS%g + s%@SHOBJ_LIBS@%$SHOBJ_LIBS%g + s%@SHOBJ_STATUS@%$SHOBJ_STATUS%g s%@PROFILE_FLAGS@%$PROFILE_FLAGS%g s%@incdir@%$incdir%g s%@BUILD_DIR@%$BUILD_DIR%g + s%@ARFLAGS@%$ARFLAGS%g s%@BASHVERS@%$BASHVERS%g s%@BASHPATCH@%$BASHPATCH%g diff -aNrc2 bash-2.02.1/configure.in bash-2.03/configure.in *** bash-2.02.1/configure.in Thu Jul 16 15:08:21 1998 --- bash-2.03/configure.in Thu Feb 18 12:45:53 1999 *************** *** 1,4 **** dnl ! dnl Configure script for bash-2.02 dnl dnl report bugs to chet@po.cwru.edu --- 1,4 ---- dnl ! dnl Configure script for bash-2.03 dnl dnl report bugs to chet@po.cwru.edu *************** *** 7,11 **** dnl checks for version info ! AC_REVISION([for Bash 2.02, version 2.19, from autoconf version] AC_ACVERSION)dnl AC_INIT(shell.h) --- 7,11 ---- dnl checks for version info ! AC_REVISION([for Bash 2.03, version 2.49, from autoconf version] AC_ACVERSION)dnl AC_INIT(shell.h) *************** *** 29,32 **** --- 29,33 ---- opt_afs=no opt_curses=no + opt_with_installed_readline=no dnl some systems should be configured without gnu malloc by default *************** *** 34,51 **** dnl look in the NOTES file for more case "${host_cpu}-${host_os}" in ! alpha-*) opt_gnu_malloc=no ;; # alpha running osf/1 or linux *[Cc]ray*-*) opt_gnu_malloc=no ;; # Crays *-osf1*) opt_gnu_malloc=no ;; # other osf/1 machines sparc-svr4*) opt_gnu_malloc=no ;; # sparc SVR4, SVR4.2 sparc-netbsd*) opt_gnu_malloc=no ;; # needs 8-byte alignment ! #mips-irix6*) opt_gnu_malloc=no ;; # needs 8-byte alignment sparc-linux*) opt_gnu_malloc=no ;; # sparc running linux; requires ELF #*-freebsd*) opt_gnu_malloc=no ;; # they claim it's better *-aix*) opt_gnu_malloc=no ;; # AIX machines *-nextstep*) opt_gnu_malloc=no ;; # NeXT machines running NeXTstep *-dgux*) opt_gnu_malloc=no ;; # DG/UX machines *-qnx*) opt_gnu_malloc=no ;; # QNX 4.2 *-machten4) opt_gnu_malloc=no ;; # MachTen 4.x *-bsdi2.1|*-bsdi3.?) opt_gnu_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins *-cygwin32*) opt_gnu_malloc=no ;; # Cygnus's CYGWIN32 environment esac --- 35,54 ---- dnl look in the NOTES file for more case "${host_cpu}-${host_os}" in ! alpha*-*) opt_gnu_malloc=no ;; # alpha running osf/1 or linux *[Cc]ray*-*) opt_gnu_malloc=no ;; # Crays *-osf1*) opt_gnu_malloc=no ;; # other osf/1 machines sparc-svr4*) opt_gnu_malloc=no ;; # sparc SVR4, SVR4.2 sparc-netbsd*) opt_gnu_malloc=no ;; # needs 8-byte alignment ! mips-irix6*) opt_gnu_malloc=no ;; # needs 8-byte alignment sparc-linux*) opt_gnu_malloc=no ;; # sparc running linux; requires ELF #*-freebsd*) opt_gnu_malloc=no ;; # they claim it's better *-aix*) opt_gnu_malloc=no ;; # AIX machines *-nextstep*) opt_gnu_malloc=no ;; # NeXT machines running NeXTstep + *-rhapsody*) opt_gnu_malloc=no ;; # Apple Rhapsody *-dgux*) opt_gnu_malloc=no ;; # DG/UX machines *-qnx*) opt_gnu_malloc=no ;; # QNX 4.2 *-machten4) opt_gnu_malloc=no ;; # MachTen 4.x *-bsdi2.1|*-bsdi3.?) opt_gnu_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins + *-beos*) opt_gnu_malloc=no ;; # they say it's suitable *-cygwin32*) opt_gnu_malloc=no ;; # Cygnus's CYGWIN32 environment esac *************** *** 57,60 **** --- 60,64 ---- AC_ARG_WITH(glibc-malloc, --with-glibc-malloc use the GNU C library version of malloc,opt_glibc_malloc=$withval) AC_ARG_WITH(gnu-malloc, --with-gnu-malloc use the GNU version of malloc,opt_gnu_malloc=$withval) + AC_ARG_WITH(installed-readline, --with-installed-readline use a version of the readline library that is already installed, opt_with_installed_readline=$withval) AC_ARG_WITH(purecov, --with-purecov configure to postprocess with pure coverage, opt_purecov=$withval) AC_ARG_WITH(purify, --with-purify configure to postprocess with purify, opt_purify=$withval) *************** *** 157,184 **** dnl opt_job_control is handled later, after BASH_JOB_CONTROL_MISSING runs if test $opt_alias = yes; then AC_DEFINE(ALIAS) fi - if test $opt_readline = yes; then - AC_DEFINE(READLINE) - READLINE_LIB=-lreadline - READLINE_DEP='$(READLINE_LIBRARY)' - else - READLINE_LIB= READLINE_DEP= - fi - if test $opt_history = yes; then - AC_DEFINE(HISTORY) - HISTORY_LIB=-lhistory - HISTORY_DEP='$(HISTORY_LIBRARY)' - else - HISTORY_LIB= HISTORY_DEP= - fi - if test $opt_bang_history = yes; then - AC_DEFINE(BANG_HISTORY) - HISTORY_LIB=-lhistory - HISTORY_DEP='$(HISTORY_LIBRARY)' - else - HISTORY_LIB= HISTORY_DEP= - fi if test $opt_dirstack = yes; then AC_DEFINE(PUSHD_AND_POPD) --- 161,171 ---- dnl opt_job_control is handled later, after BASH_JOB_CONTROL_MISSING runs + dnl opt_readline and opt_history are handled later, because AC_PROG_CC needs + dnl to be run before we can check the version of an already-installed readline + dnl library + if test $opt_alias = yes; then AC_DEFINE(ALIAS) fi if test $opt_dirstack = yes; then AC_DEFINE(PUSHD_AND_POPD) *************** *** 235,242 **** AC_SUBST(MALLOC_TARGET) AC_SUBST(MALLOC_SRC) - AC_SUBST(READLINE_LIB) - AC_SUBST(READLINE_DEP) - AC_SUBST(HISTORY_LIB) - AC_SUBST(HISTORY_DEP) dnl Use GNU m4 macros to get the distribution and patchlevel information --- 222,225 ---- *************** *** 257,278 **** AC_MINIX ! dnl BEGIN changes for CYGNUS cross-building for cygwin32 dnl load up the cross-building cache file -- add more cases and cache dnl files as necessary if test "x$cross_compiling" = "xyes"; then case "${host}" in *-cygwin32*) cross_cache=${srcdir}/cross-build/cygwin32.cache ! if test -r "${cross_cache}"; then ! echo "loading cross-build cache file ${cross_cache}" ! . ${cross_cache} ! fi ! unset cross_cache ;; ! *) echo "configure: cross-compiling for a non-cygwin32 target is not supported" >&2 ;; esac fi if test -z "$CC_FOR_BUILD"; then --- 240,274 ---- AC_MINIX ! dnl BEGIN changes for cross-building for cygwin32 and BeOS ! ! SIGNAMES_H=lsignames.h dnl load up the cross-building cache file -- add more cases and cache dnl files as necessary + + dnl Note that host and target machine are the same, and different than the + dnl build machine. + dnl Set SIGNAMES_H based on whether or not we're cross-compiling. + if test "x$cross_compiling" = "xyes"; then case "${host}" in *-cygwin32*) cross_cache=${srcdir}/cross-build/cygwin32.cache ! SIGNAMES_H='$(srcdir)/cross-build/win32sig.h' ;; ! i[[3456]]86-*-beos*) ! cross_cache=${srcdir}/cross-build/x86-beos.cache ! SIGNAMES_H='${srcdir}/cross-build/beos-sig.h' ! ;; ! *) echo "configure: cross-compiling for $host is not supported" >&2 ;; esac + if test -n "${cross_cache}" && test -r "${cross_cache}"; then + echo "loading cross-build cache file ${cross_cache}" + . ${cross_cache} + fi + unset cross_cache fi + AC_SUBST(SIGNAMES_H) if test -z "$CC_FOR_BUILD"; then *************** *** 285,297 **** AC_SUBST(CC_FOR_BUILD) ! dnl Set SIGNAMES_H based on whether or not we're cross-compiling ! if test "x$cross_compiling" = "xno"; then ! SIGNAMES_H=lsignames.h ! else ! SIGNAMES_H='$(srcdir)/cross-build/win32sig.h' ! fi ! AC_SUBST(SIGNAMES_H) ! ! dnl END changes for CYGNUS cross-building for cygwin32 dnl We want these before the checks, so the checks can modify their values. --- 281,285 ---- AC_SUBST(CC_FOR_BUILD) ! dnl END changes for cross-building dnl We want these before the checks, so the checks can modify their values. *************** *** 305,309 **** if test "$opt_profiling" = "yes"; then PROFILE_FLAGS=-pg ! opt_static_link=yes fi --- 293,300 ---- if test "$opt_profiling" = "yes"; then PROFILE_FLAGS=-pg ! case "$host_os" in ! solaris2*) ;; ! *) opt_static_link=yes ;; ! esac fi *************** *** 311,315 **** # if we're using gcc, add `-static' to LDFLAGS if test -n "$GCC" || test "$ac_cv_prog_gcc" = "yes"; then ! LDFLAGS="$LDFLAGS -static" fi fi --- 302,306 ---- # if we're using gcc, add `-static' to LDFLAGS if test -n "$GCC" || test "$ac_cv_prog_gcc" = "yes"; then ! STATIC_LD="-static" fi fi *************** *** 318,331 **** --- 309,404 ---- AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) + AC_SUBST(STATIC_LD) AC_PROG_GCC_TRADITIONAL + dnl BEGIN READLINE and HISTORY LIBRARY SECTION + dnl prepare to allow bash to be linked against an already-installed readline + + dnl first test that the readline version is new enough to link bash against + if test "$opt_readline" = yes && test "$opt_with_installed_readline" = "yes" + then + + dnl we duplicate some work that's done later here so we can look in + dnl the correct directory for the readline library + + test "x$prefix" = xNONE && _rl_prefix=$ac_default_prefix || _rl_prefix=${prefix} + test "x$exec_prefix" = xNONE && _rl_exec_prefix=${_rl_prefix} || _rl_exec_prefix=${exec_prefix} + + AC_MSG_CHECKING(version of installed readline library) + _rl_version=`exec_prefix=${_rl_exec_prefix} ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/rlvers.sh -C "${CC}" -L ${libdir}` + AC_MSG_RESULT($_rl_version) + + case "$_rl_version" in + 3*|4*|5*|6*|7*|8*|9*) ;; + *) opt_with_installed_readline=no + AC_MSG_WARN(installed readline library is too old to be linked with bash) + AC_MSG_WARN(using private bash version) + ;; + esac + unset _rl_version _rl_prefix _rl_exec_prefix + fi + + if test $opt_readline = yes; then + AC_DEFINE(READLINE) + READLINE_LIB=-lreadline + if test "$opt_with_installed_readline" = "yes" ; then + RL_LIBDIR='$(libdir)' + READLINE_DEP= + RL_INCLUDE='-I$(includedir)' + else + RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + READLINE_DEP='$(READLINE_LIBRARY)' + fi + else + RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + READLINE_LIB= READLINE_DEP= + fi + if test $opt_history = yes || test $opt_bang_history = yes; then + if test $opt_history = yes; then + AC_DEFINE(HISTORY) + fi + if test $opt_bang_history = yes; then + AC_DEFINE(BANG_HISTORY) + fi + HISTORY_LIB=-lhistory + if test "$opt_with_installed_readline" = "yes"; then + HIST_LIBDIR='$(libdir)' + HISTORY_DEP= + RL_INCLUDE='-I$(includedir)' + else + HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + HISTORY_DEP='$(HISTORY_LIBRARY)' + fi + else + HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + HISTORY_LIB= HISTORY_DEP= + fi + AC_SUBST(READLINE_LIB) + AC_SUBST(READLINE_DEP) + AC_SUBST(RL_LIBDIR) + AC_SUBST(RL_INCLUDE) + AC_SUBST(HISTORY_LIB) + AC_SUBST(HISTORY_DEP) + AC_SUBST(HIST_LIBDIR) + + dnl END READLINE and HISTORY LIBRARY SECTION + dnl programs needed by the build and install process AC_PROG_INSTALL AC_CHECK_PROG(AR, ar, ar) + dnl Set default for ARFLAGS, since autoconf does not have a macro for it. + dnl This allows people to set it when running configure or make + test -n "$ARFLAGS" || ARFLAGS="cr" AC_PROG_RANLIB AC_PROG_YACC AC_PROG_MAKE_SET + case "$host_os" in + opennt*|interix*) MAKE_SHELL="$OPENNT_ROOT/bin/sh" ;; + *) MAKE_SHELL=/bin/sh ;; + esac + AC_SUBST(MAKE_SHELL) + dnl special checks for libc functions AC_FUNC_ALLOCA *************** *** 358,363 **** dnl checks for system calls AC_CHECK_FUNCS(dup2 select getdtablesize getgroups gethostname \ ! setdtablesize getpagesize killpg lstat getpeername \ ! getrlimit getrusage gettimeofday waitpid tcgetpgrp) dnl checks for c library functions --- 431,436 ---- dnl checks for system calls AC_CHECK_FUNCS(dup2 select getdtablesize getgroups gethostname \ ! setdtablesize getpagesize killpg lstat getpeername sbrk \ ! getrlimit getrusage gettimeofday waitpid tcgetpgrp rename) dnl checks for c library functions *************** *** 419,439 **** AC_TYPE_SIGNAL ! AC_CHECK_SIZEOF(int) ! AC_CHECK_SIZEOF(long) ! AC_CHECK_SIZEOF(char *) ! ! AC_CHECK_TYPE(int32_t) ! if test "$ac_cv_type_int32_t" = "no"; then ! BASH_TYPE_INT32_T ! fi ! AC_CHECK_TYPE(u_int32_t) ! if test "$ac_cv_type_u_int32_t" = "no"; then ! BASH_TYPE_U_INT32_T ! fi ! ! AC_CHECK_TYPE(ptrdiff_t) ! if test "$ac_cv_type_ptrdiff_t" = "no"; then ! BASH_TYPE_PTRDIFF_T ! fi dnl structures --- 492,504 ---- AC_TYPE_SIGNAL ! AC_CHECK_SIZEOF(int, 4) ! AC_CHECK_SIZEOF(long, 4) ! AC_CHECK_SIZEOF(char *, 4) ! AC_CHECK_SIZEOF(double, 8) ! ! BASH_TYPE_INT32_T ! BASH_TYPE_U_INT32_T ! BASH_TYPE_PTRDIFF_T ! BASH_TYPE_BITS64_T dnl structures *************** *** 557,577 **** dnl this should really go away someday ! case "$host_os" in sysv4.2*) AC_DEFINE(SVR4_2) AC_DEFINE(SVR4) ;; sysv4*) AC_DEFINE(SVR4) ;; hpux*) LOCAL_CFLAGS=-DHPUX ;; dgux*) LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;; isc*) LOCAL_CFLAGS=-Disc386;; ! sco3.2v5*) LOCAL_CFLAGS="-DWAITPID_BROKEN -DNO_MEMSCRAMBLE -DPATH_MAX=1024" ;; sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DNO_MEMSCRAMBLE -DPATH_MAX=1024" ;; sco3.2*) LOCAL_CFLAGS=-DMUST_UNBLOCK_CHLD ;; sunos4*) LOCAL_CFLAGS=-DSunOS4 ;; solaris2.5*) LOCAL_CFLAGS=-DSunOS5 ;; linux*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading - aix4.2*) LOCAL_LDFLAGS="-bexpall -brtl" ;;# allow dynamic loading *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s -lunix -lncurses" ;; ! powerux) LOCAL_LIBS="-lgen" ;; cygwin32*) LOCAL_LIBS="-luser32" ;; esac --- 622,652 ---- dnl this should really go away someday ! case "${host_os}" in sysv4.2*) AC_DEFINE(SVR4_2) AC_DEFINE(SVR4) ;; sysv4*) AC_DEFINE(SVR4) ;; + sysv5*) AC_DEFINE(SVR5) ;; + hpux9*) LOCAL_CFLAGS="-DHPUX9 -DHPUX" ;; hpux*) LOCAL_CFLAGS=-DHPUX ;; dgux*) LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;; isc*) LOCAL_CFLAGS=-Disc386;; ! sco3.2v5*) LOCAL_CFLAGS="-b elf -DWAITPID_BROKEN -DNO_MEMSCRAMBLE -DPATH_MAX=1024" ;; sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DNO_MEMSCRAMBLE -DPATH_MAX=1024" ;; sco3.2*) LOCAL_CFLAGS=-DMUST_UNBLOCK_CHLD ;; sunos4*) LOCAL_CFLAGS=-DSunOS4 ;; solaris2.5*) LOCAL_CFLAGS=-DSunOS5 ;; + lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; linux*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s -lunix -lncurses" ;; ! powerux*) LOCAL_LIBS="-lgen" ;; cygwin32*) LOCAL_LIBS="-luser32" ;; + opennt*|interix*) LOCAL_CFLAGS="-DNO_MAIN_ENV_ARG" ;; + esac + + dnl Stanza for OS/compiler pair-specific flags + case "${host_os}-${CC}" in + aix4.2*-*gcc*) LOCAL_LDFLAGS="-Xlinker -bexpall -Xlinker -brtl" ;; + aix4.2*) LOCAL_LDFLAGS="-bexpall -brtl" ;; + bsdi4*-*gcc*) LOCAL_LDFLAGS="-rdynamic" ;; # allow dynamic loading, like Linux esac *************** *** 589,592 **** --- 664,685 ---- esac + # + # Shared object configuration section. These values are generated by + # ${srcdir}/support/shobj-conf + # + if test "$ac_cv_func_dlopen" = "yes" && test -f ${srcdir}/support/shobj-conf + then + AC_MSG_CHECKING(shared object configuration for loadable builtins) + eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C ${CC} -c ${host_cpu} -o ${host_os} -v ${host_vendor}` + AC_SUBST(SHOBJ_CC) + AC_SUBST(SHOBJ_CFLAGS) + AC_SUBST(SHOBJ_LD) + AC_SUBST(SHOBJ_LDFLAGS) + AC_SUBST(SHOBJ_XLDFLAGS) + AC_SUBST(SHOBJ_LIBS) + AC_SUBST(SHOBJ_STATUS) + AC_MSG_RESULT($SHOBJ_STATUS) + fi + # try to create a directory tree if the source is elsewhere # this should be packaged into a script accessible via ${srcdir}/support *************** *** 612,615 **** --- 705,709 ---- AC_SUBST(YACC) AC_SUBST(AR) + AC_SUBST(ARFLAGS) AC_SUBST(BASHVERS) *************** *** 617,620 **** --- 711,715 ---- AC_SUBST(host_cpu) + AC_SUBST(host_vendor) AC_SUBST(host_os) diff -aNrc2 bash-2.02.1/cross-build/beos-sig.h bash-2.03/cross-build/beos-sig.h *** bash-2.02.1/cross-build/beos-sig.h Wed Dec 31 19:00:00 1969 --- bash-2.03/cross-build/beos-sig.h Thu Aug 6 14:39:03 1998 *************** *** 0 **** --- 1,36 ---- + /* This file is used when cross compiling bash to run native on BeOS. */ + + #ifndef __GNUC__ + # error cross compiling requires gcc + #endif + + /* A translation list so we can be polite to our users. + Use gcc labelled initializers to set up the array. Note that + some entries might wind up being NULL. */ + + char *signal_names[NSIG + 2] = { + [0] "EXIT", + [SIGHUP] "SIGHUP", + [SIGINT] "SIGINT", + [SIGQUIT] "SIGQUIT", + [SIGILL] "SIGILL", + [SIGCHLD] "SIGCHLD", + [SIGABRT] "SIGABRT", + [SIGPIPE] "SIGPIPE", + [SIGFPE] "SIGFPE", + [SIGKILL] "SIGKILL", + [SIGSTOP] "SIGSTOP", + [SIGSEGV] "SIGSEGV", + [SIGCONT] "SIGCONT", + [SIGTSTP] "SIGTSTP", + [SIGALRM] "SIGALRM", + [SIGTERM] "SIGTERM", + [SIGTTIN] "SIGTTIN", + [SIGTTOU] "SIGTTOU", + [SIGUSR1] "SIGUSR1", + [SIGUSR2] "SIGUSR2", + [SIGWINCH] "SIGWINCH", + [SIGKILLTHR] "SIGKILLTHR", + [NSIG] "DEBUG", + [NSIG + 1] (char *)0x0, + }; diff -aNrc2 bash-2.02.1/cross-build/cygwin32.cache bash-2.03/cross-build/cygwin32.cache *** bash-2.02.1/cross-build/cygwin32.cache Fri Jan 30 12:44:53 1998 --- bash-2.03/cross-build/cygwin32.cache Mon Jul 13 11:09:36 1998 *************** *** 15,18 **** --- 15,19 ---- ac_cv_sizeof_int=${ac_cv_sizeof_int='4'} ac_cv_sizeof_long=${ac_cv_sizeof_long='4'} + ac_cv_sizeof_double=${ac_cv_sizeof_double='8'} bash_cv_dup2_broken=${bash_cv_dup2_broken='no'} *************** *** 36,39 **** --- 37,42 ---- bash_cv_type_int32_t=${bash_cv_type_int32_t='int'} bash_cv_type_u_int32_t=${bash_cv_type_u_int32_t='int'} + + ac_cv_type_bits64_t=${ac_cv_type_bits64_t='no'} # end of cross-build/cygwin32.cache diff -aNrc2 bash-2.02.1/cross-build/opennt.cache bash-2.03/cross-build/opennt.cache *** bash-2.02.1/cross-build/opennt.cache Wed Dec 31 19:00:00 1969 --- bash-2.03/cross-build/opennt.cache Thu Feb 18 13:09:26 1999 *************** *** 0 **** --- 1,169 ---- + # This file is a shell script that caches the results of configure + # tests run on this system so they can be shared between configure + # scripts and configure runs. It is not useful on other systems. + # If it contains results you don't want to keep, you may remove or edit it. + # + # By default, configure uses ./config.cache as the cache file, + # creating it if it does not exist already. You can give configure + # the --cache-file=FILE option to use a different cache file; that is + # what configure does when it calls configure scripts in + # subdirectories, so they share the cache. + # Giving --cache-file=/dev/null disables caching, for debugging configure. + # config.status only pays attention to the cache file if you give it the + # --recheck option to rerun configure. + # + ac_cv_c_bigendian=${ac_cv_c_bigendian=no} + ac_cv_decl_sys_siglist=${ac_cv_decl_sys_siglist=no} + ac_cv_func___setostype=${ac_cv_func___setostype=no} + ac_cv_func_alloca_works=${ac_cv_func_alloca_works=yes} + ac_cv_func_bcopy=${ac_cv_func_bcopy=yes} + ac_cv_func_bindtextdomain=${ac_cv_func_bindtextdomain=no} + ac_cv_func_bzero=${ac_cv_func_bzero=yes} + ac_cv_func_confstr=${ac_cv_func_confstr=yes} + ac_cv_func_dlclose=${ac_cv_func_dlclose=no} + ac_cv_func_dlopen=${ac_cv_func_dlopen=no} + ac_cv_func_dlsym=${ac_cv_func_dlsym=no} + ac_cv_func_dup2=${ac_cv_func_dup2=yes} + ac_cv_func_getcwd=${ac_cv_func_getcwd=yes} + ac_cv_func_getdtablesize=${ac_cv_func_getdtablesize=no} + ac_cv_func_getgroups=${ac_cv_func_getgroups=yes} + ac_cv_func_gethostname=${ac_cv_func_gethostname=yes} + ac_cv_func_getpagesize=${ac_cv_func_getpagesize=yes} + ac_cv_func_getpeername=${ac_cv_func_getpeername=yes} + ac_cv_func_getpgrp_void=${ac_cv_func_getpgrp_void=yes} + ac_cv_func_getrlimit=${ac_cv_func_getrlimit=no} + ac_cv_func_getrusage=${ac_cv_func_getrusage=no} + ac_cv_func_gettext=${ac_cv_func_gettext=no} + ac_cv_func_gettimeofday=${ac_cv_func_gettimeofday=yes} + ac_cv_func_killpg=${ac_cv_func_killpg=yes} + ac_cv_func_lstat=${ac_cv_func_lstat=no} + ac_cv_func_memmove=${ac_cv_func_memmove=yes} + ac_cv_func_mkfifo=${ac_cv_func_mkfifo=yes} + ac_cv_func_putenv=${ac_cv_func_putenv=yes} + ac_cv_func_rename=${ac_cv_func_rename=yes} + ac_cv_func_sbrk=${ac_cv_func_sbrk=no} + ac_cv_func_select=${ac_cv_func_select=yes} + ac_cv_func_setdtablesize=${ac_cv_func_setdtablesize=no} + ac_cv_func_setenv=${ac_cv_func_setenv=yes} + ac_cv_func_setlinebuf=${ac_cv_func_setlinebuf=yes} + ac_cv_func_setlocale=${ac_cv_func_setlocale=yes} + ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no} + ac_cv_func_siginterrupt=${ac_cv_func_siginterrupt=no} + ac_cv_func_strcasecmp=${ac_cv_func_strcasecmp=yes} + ac_cv_func_strchr=${ac_cv_func_strchr=yes} + ac_cv_func_strcoll_works=${ac_cv_func_strcoll_works=yes} + ac_cv_func_strerror=${ac_cv_func_strerror=yes} + ac_cv_func_strtod=${ac_cv_func_strtod=yes} + ac_cv_func_strtol=${ac_cv_func_strtol=yes} + ac_cv_func_strtoul=${ac_cv_func_strtoul=yes} + ac_cv_func_sysconf=${ac_cv_func_sysconf=yes} + ac_cv_func_tcgetattr=${ac_cv_func_tcgetattr=yes} + ac_cv_func_tcgetpgrp=${ac_cv_func_tcgetpgrp=yes} + ac_cv_func_textdomain=${ac_cv_func_textdomain=no} + ac_cv_func_times=${ac_cv_func_times=yes} + ac_cv_func_tzset=${ac_cv_func_tzset=yes} + ac_cv_func_ulimit=${ac_cv_func_ulimit=no} + ac_cv_func_uname=${ac_cv_func_uname=yes} + ac_cv_func_vprintf=${ac_cv_func_vprintf=yes} + ac_cv_func_wait3=${ac_cv_func_wait3=no} + ac_cv_func_wait3_rusage=${ac_cv_func_wait3_rusage=no} + ac_cv_func_waitpid=${ac_cv_func_waitpid=yes} + ac_cv_header_alloca_h=${ac_cv_header_alloca_h=no} + ac_cv_header_dirent_dirent_h=${ac_cv_header_dirent_dirent_h=yes} + ac_cv_header_dlfcn_h=${ac_cv_header_dlfcn_h=no} + ac_cv_header_libintl_h=${ac_cv_header_libintl_h=no} + ac_cv_header_limits_h=${ac_cv_header_limits_h=yes} + ac_cv_header_locale_h=${ac_cv_header_locale_h=yes} + ac_cv_header_memory_h=${ac_cv_header_memory_h=yes} + ac_cv_header_minix_config_h=${ac_cv_header_minix_config_h=no} + ac_cv_header_stat_broken=${ac_cv_header_stat_broken=no} + ac_cv_header_stdarg_h=${ac_cv_header_stdarg_h=yes} + ac_cv_header_stdc=${ac_cv_header_stdc=yes} + ac_cv_header_stdlib_h=${ac_cv_header_stdlib_h=yes} + ac_cv_header_string_h=${ac_cv_header_string_h=yes} + ac_cv_header_sys_file_h=${ac_cv_header_sys_file_h=yes} + ac_cv_header_sys_param_h=${ac_cv_header_sys_param_h=yes} + ac_cv_header_sys_pte_h=${ac_cv_header_sys_pte_h=no} + ac_cv_header_sys_ptem_h=${ac_cv_header_sys_ptem_h=no} + ac_cv_header_sys_resource_h=${ac_cv_header_sys_resource_h=no} + ac_cv_header_sys_select_h=${ac_cv_header_sys_select_h=no} + ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=yes} + ac_cv_header_sys_stream_h=${ac_cv_header_sys_stream_h=no} + ac_cv_header_sys_time_h=${ac_cv_header_sys_time_h=yes} + ac_cv_header_sys_times_h=${ac_cv_header_sys_times_h=yes} + ac_cv_header_sys_wait_h=${ac_cv_header_sys_wait_h=yes} + ac_cv_header_termcap_h=${ac_cv_header_termcap_h=no} + ac_cv_header_termio_h=${ac_cv_header_termio_h=no} + ac_cv_header_termios_h=${ac_cv_header_termios_h=yes} + ac_cv_header_time=${ac_cv_header_time=yes} + ac_cv_header_unistd_h=${ac_cv_header_unistd_h=yes} + ac_cv_header_varargs_h=${ac_cv_header_varargs_h=no} + ac_cv_lib_dir_opendir=${ac_cv_lib_dir_opendir=no} + ac_cv_lib_dl_dlopen=${ac_cv_lib_dl_dlopen=no} + ac_cv_lib_intl_bindtextdomain=${ac_cv_lib_intl_bindtextdomain=no} + ac_cv_lib_termcap_tgetent=${ac_cv_lib_termcap_tgetent=yes} + ac_cv_path_install=${ac_cv_path_install='//C/OpenNT21b3/bin/install -c'} + ac_cv_prog_AR=${ac_cv_prog_AR=ar} + ac_cv_prog_CC=${ac_cv_prog_CC=gcc} + ac_cv_prog_CPP=${ac_cv_prog_CPP='cc -E'} + ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB=:} + ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross=no} + ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes} + ac_cv_prog_cc_works=${ac_cv_prog_cc_works=yes} + ac_cv_prog_gcc=${ac_cv_prog_gcc=yes} + ac_cv_prog_gcc_traditional=${ac_cv_prog_gcc_traditional=no} + ac_cv_prog_make_make_set=${ac_cv_prog_make_make_set=yes} + ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4} + ac_cv_sizeof_double=${ac_cv_sizeof_double=8} + ac_cv_sizeof_int=${ac_cv_sizeof_int=4} + ac_cv_sizeof_long=${ac_cv_sizeof_long=4} + ac_cv_sys_interpreter=${ac_cv_sys_interpreter=yes} + ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls=no} + ac_cv_type_getgroups=${ac_cv_type_getgroups=gid_t} + ac_cv_type_mode_t=${ac_cv_type_mode_t=yes} + ac_cv_type_off_t=${ac_cv_type_off_t=yes} + ac_cv_type_pid_t=${ac_cv_type_pid_t=yes} + ac_cv_type_signal=${ac_cv_type_signal=void} + ac_cv_type_size_t=${ac_cv_type_size_t=yes} + ac_cv_type_time_t=${ac_cv_type_time_t=yes} + ac_cv_type_uid_t=${ac_cv_type_uid_t=yes} + bash_cv_can_redecl_getpw=${bash_cv_can_redecl_getpw=yes} + bash_cv_decl_under_sys_siglist=${bash_cv_decl_under_sys_siglist=no} + bash_cv_dev_fd=${bash_cv_dev_fd=absent} + bash_cv_dirent_has_d_fileno=${bash_cv_dirent_has_d_fileno=no} + bash_cv_dirent_has_dino=${bash_cv_dirent_has_dino=yes} + bash_cv_dup2_broken=${bash_cv_dup2_broken=no} + bash_cv_fionread_in_ioctl=${bash_cv_fionread_in_ioctl=yes} + bash_cv_func_lstat=${bash_cv_func_lstat=no} + bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present} + bash_cv_func_strcoll_broken=${bash_cv_func_strcoll_broken=no} + bash_cv_getcwd_calls_popen=${bash_cv_getcwd_calls_popen=no} + bash_cv_getenv_redef=${bash_cv_getenv_redef=yes} + bash_cv_have_strsignal=${bash_cv_have_strsignal=yes} + bash_cv_job_control_missing=${bash_cv_job_control_missing=present} + bash_cv_mail_dir=${bash_cv_mail_dir=/usr/spool/mail} + bash_cv_must_reinstall_sighandlers=${bash_cv_must_reinstall_sighandlers=no} + bash_cv_opendir_not_robust=${bash_cv_opendir_not_robust=no} + bash_cv_pgrp_pipe=${bash_cv_pgrp_pipe=no} + bash_cv_printf_declared=${bash_cv_printf_declared=yes} + bash_cv_sbrk_declared=${bash_cv_sbrk_declared=no} + bash_cv_signal_vintage=${bash_cv_signal_vintage=posix} + bash_cv_speed_t_in_sys_types=${bash_cv_speed_t_in_sys_types=no} + bash_cv_struct_timeval=${bash_cv_struct_timeval=yes} + bash_cv_struct_winsize_header=${bash_cv_struct_winsize_header=ioctl_h} + bash_cv_struct_winsize_in_ioctl=${bash_cv_struct_winsize_in_ioctl=yes} + bash_cv_sys_errlist=${bash_cv_sys_errlist=yes} + bash_cv_sys_named_pipes=${bash_cv_sys_named_pipes=present} + bash_cv_sys_siglist=${bash_cv_sys_siglist=yes} + bash_cv_termcap_lib=${bash_cv_termcap_lib=libtermcap} + bash_cv_termio_ldisc=${bash_cv_termio_ldisc=no} + bash_cv_termios_ldisc=${bash_cv_termios_ldisc=no} + bash_cv_tiocgwinsz_in_ioctl=${bash_cv_tiocgwinsz_in_ioctl=yes} + bash_cv_tiocstat_in_ioctl=${bash_cv_tiocstat_in_ioctl=no} + bash_cv_type_clock_t=${bash_cv_type_clock_t=yes} + bash_cv_type_quad_t=${bash_cv_type_quad_t=yes} + bash_cv_type_rlimit=${bash_cv_type_rlimit=long} + bash_cv_type_sigset_t=${bash_cv_type_sigset_t=yes} + bash_cv_ulimit_maxfds=${bash_cv_ulimit_maxfds=no} + bash_cv_under_sys_siglist=${bash_cv_under_sys_siglist=no} + bash_cv_void_sighandler=${bash_cv_void_sighandler=yes} diff -aNrc2 bash-2.02.1/cross-build/x86-beos.cache bash-2.03/cross-build/x86-beos.cache *** bash-2.02.1/cross-build/x86-beos.cache Wed Dec 31 19:00:00 1969 --- bash-2.03/cross-build/x86-beos.cache Tue Aug 25 11:12:28 1998 *************** *** 0 **** --- 1,45 ---- + # This file is a shell script that caches the results of configure + # tests for x86 BeOS so they don't need to be done when cross-compiling. + + # AC_FUNC_GETPGRP should also define GETPGRP_VOID + ac_cv_func_getpgrp_void=${ac_cv_func_getpgrp_void='yes'} + # AC_FUNC_SETVBUF_REVERSED should not define anything else + ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed='no'} + # on BeOS, system calls do not restart + ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls='no'} + bash_cv_sys_restartable_syscalls=${bash_cv_sys_restartable_syscalls='no'} + + ac_cv_func_tcgetattr=${ac_cv_func_tcgetattr='yes'} + + # x86 BeOS is little endian + ac_cv_c_bigendian=${ac_cv_c_bigendian='no'} + ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p='4'} + ac_cv_sizeof_int=${ac_cv_sizeof_int='4'} + ac_cv_sizeof_long=${ac_cv_sizeof_long='4'} + ac_cv_sizeof_double=${ac_cv_sizeof_double='8'} + + bash_cv_dev_fd=${bash_cv_dev_fd='absent'} + bash_cv_dup2_broken=${bash_cv_dup2_broken='no'} + bash_cv_pgrp_pipe=${bash_cv_pgrp_pipe='no'} + bash_cv_type_rlimit=${bash_cv_type_rlimit='long'} + bash_cv_decl_under_sys_siglist=${bash_cv_decl_under_sys_siglist='no'} + bash_cv_under_sys_siglist=${bash_cv_under_sys_siglist='no'} + bash_cv_sys_siglist=${bash_cv_sys_siglist='yes'} + bash_cv_opendir_not_robust=${bash_cv_opendir_not_robust='no'} + bash_cv_getenv_redef=${bash_cv_getenv_redef='yes'} + bash_cv_printf_declared=${bash_cv_printf_declared='yes'} + bash_cv_ulimit_maxfds=${bash_cv_ulimit_maxfds='no'} + bash_cv_getcwd_calls_popen=${bash_cv_getcwd_calls_popen='no'} + bash_cv_must_reinstall_sighandlers=${bash_cv_must_reinstall_sighandlers='no'} + bash_cv_job_control_missing=${bash_cv_job_control_missing='present'} + bash_cv_sys_named_pipes=${bash_cv_sys_named_pipes='present'} + bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp='missing'} + bash_cv_mail_dir=${bash_cv_mail_dir='unknown'} + bash_cv_func_strcoll_broken=${bash_cv_func_strcoll_broken='no'} + + bash_cv_type_int32_t=${bash_cv_type_int32_t='int'} + bash_cv_type_u_int32_t=${bash_cv_type_u_int32_t='int'} + + ac_cv_type_bits64_t=${ac_cv_type_bits64_t='no'} + + # end of cross-build/x86-beos.cache diff -aNrc2 bash-2.02.1/dispose_cmd.c bash-2.03/dispose_cmd.c *** bash-2.02.1/dispose_cmd.c Thu Jan 29 14:52:25 1998 --- bash-2.03/dispose_cmd.c Tue Jan 12 12:43:04 1999 *************** *** 170,174 **** default: ! programming_error ("dispose_command: bad command type `%d'", command->type); break; } --- 170,174 ---- default: ! command_error ("dispose_command", CMDERR_BADTYPE, command->type, 0); break; } diff -aNrc2 bash-2.02.1/doc/FAQ bash-2.03/doc/FAQ *** bash-2.02.1/doc/FAQ Fri Jul 10 12:46:28 1998 --- bash-2.03/doc/FAQ Thu Feb 18 12:55:54 1999 *************** *** 1,3 **** ! This is the Bash FAQ, version 2.13, for Bash version 2.02. This document contains a set of frequently-asked questions concerning --- 1,3 ---- ! This is the Bash FAQ, version 3.0, for Bash version 2.03. This document contains a set of frequently-asked questions concerning *************** *** 21,58 **** Section A: The Basics ! 1) What is it? ! 2) What's the latest version? ! 3) Where can I get it? ! 4) On what machines will bash run? ! 5) Will bash run on operating systems other than Unix? ! 6) How can I build bash with gcc? ! 7) How can I make bash my login shell? ! 8) I just changed my login shell to bash, and now I can't FTP into my ! machine. Why not? ! 9) What's the `POSIX 1003.2 standard'? ! 10) What is the bash `posix mode'? Section B: The latest version ! 11) What's new in version 2.02? ! 12) Are there any user-visible incompatibilities between bash-2.02 and bash-1.14.7? Section C: Differences from other Unix shells ! 13) How does bash differ from sh, the Bourne shell? ! 14) How does bash differ from the Korn shell, version ksh88? ! 15) Which new features in ksh-93 are not in bash, and which are? Section D: Why does bash do some things differently than other Unix shells? ! 16) Why does bash run a different version of `command' than `which command' says it will? ! 17) Why doesn't bash treat brace expansions exactly like csh? ! 18) Why doesn't bash have csh variable modifiers? ! 19) How can I make my csh aliases work when I convert to bash? ! 20) How can I pipe standard output and standard error from one command to another, like csh does with `|&'? ! 21) Now that I've converted from ksh to bash, are there equivalents to ksh features like autoloaded functions and the `whence' command? --- 21,58 ---- Section A: The Basics ! A1) What is it? ! A2) What's the latest version? ! A3) Where can I get it? ! A4) On what machines will bash run? ! A5) Will bash run on operating systems other than Unix? ! A6) How can I build bash with gcc? ! A7) How can I make bash my login shell? ! A8) I just changed my login shell to bash, and now I can't FTP into my ! machine. Why not? ! A9) What's the `POSIX 1003.2 standard'? ! A10) What is the bash `posix mode'? Section B: The latest version ! B1) What's new in version 2.03? ! B2) Are there any user-visible incompatibilities between bash-2.03 and bash-1.14.7? Section C: Differences from other Unix shells ! C1) How does bash differ from sh, the Bourne shell? ! C2) How does bash differ from the Korn shell, version ksh88? ! C3) Which new features in ksh-93 are not in bash, and which are? Section D: Why does bash do some things differently than other Unix shells? ! D1) Why does bash run a different version of `command' than `which command' says it will? ! D2) Why doesn't bash treat brace expansions exactly like csh? ! D3) Why doesn't bash have csh variable modifiers? ! D4) How can I make my csh aliases work when I convert to bash? ! D5) How can I pipe standard output and standard error from one command to another, like csh does with `|&'? ! D6) Now that I've converted from ksh to bash, are there equivalents to ksh features like autoloaded functions and the `whence' command? *************** *** 60,105 **** things the way it does? ! 22) Why is the bash builtin `test' slightly different from /bin/test? ! 23) Why does bash sometimes say `Broken pipe'? ! 24) How can I get bash to read and display eight-bit characters? ! 25) How do I write a function `x' to replace builtin command `x', but still invoke the command from within the function? ! 26) When I have terminal escape sequences in my prompt, why does bash wrap lines at the wrong column? ! 27) How can I find the value of a shell variable whose name is the value of another shell variable? ! 28) If I pipe the output of a command into `read variable', why doesn't the output show up in $variable when the read command finishes? ! 29) I have a bunch of shell scripts that use backslash-escaped characters in arguments to `echo'. Bash doesn't interpret these characters. Why not, and how can I make it understand them? ! 30) Why doesn't a while or for loop get suspended when I type ^Z? ! 31) How can I make the bash `time' reserved word print timing output that ! looks like the output from my system's /usr/bin/time? Section F: Things to watch out for on certain Unix versions ! 32) Why can't I use command line editing in my `cmdtool'? ! 33) I built bash on Solaris 2. Why do globbing expansions and filename completion chop off the first few characters of each filename? ! 34) Why does bash dump core after I interrupt username completion or `~user' tilde expansion on a machine running NIS? ! 35) I'm running SVR4.2. Why is the line erased every time I type `@'? ! 36) Why does bash report syntax errors when my C News scripts use a redirection before a subshell command? Section G: Where do I go from here? ! 37) How do I report bugs in bash, and where should I look for fixes and advice? ! 38) What kind of bash documentation is there? ! 39) What's coming in future versions? ! 40) What's on the bash `wish list'? ! 41) When will the next release appear? ---------- Section A: The Basics ! 1) What is it? Bash is a Unix command interpreter (shell). It is an implementation of --- 60,105 ---- things the way it does? ! E1) Why is the bash builtin `test' slightly different from /bin/test? ! E2) Why does bash sometimes say `Broken pipe'? ! E3) How can I get bash to read and display eight-bit characters? ! E4) How do I write a function `x' to replace builtin command `x', but still invoke the command from within the function? ! E5) When I have terminal escape sequences in my prompt, why does bash wrap lines at the wrong column? ! E6) How can I find the value of a shell variable whose name is the value of another shell variable? ! E7) If I pipe the output of a command into `read variable', why doesn't the output show up in $variable when the read command finishes? ! E8) I have a bunch of shell scripts that use backslash-escaped characters in arguments to `echo'. Bash doesn't interpret these characters. Why not, and how can I make it understand them? ! E9) Why doesn't a while or for loop get suspended when I type ^Z? ! E10) How can I make the bash `time' reserved word print timing output that ! looks like the output from my system's /usr/bin/time? Section F: Things to watch out for on certain Unix versions ! F1) Why can't I use command line editing in my `cmdtool'? ! F2) I built bash on Solaris 2. Why do globbing expansions and filename completion chop off the first few characters of each filename? ! F3) Why does bash dump core after I interrupt username completion or `~user' tilde expansion on a machine running NIS? ! F4) I'm running SVR4.2. Why is the line erased every time I type `@'? ! F5) Why does bash report syntax errors when my C News scripts use a redirection before a subshell command? Section G: Where do I go from here? ! G1) How do I report bugs in bash, and where should I look for fixes and advice? ! G2) What kind of bash documentation is there? ! G3) What's coming in future versions? ! G4) What's on the bash `wish list'? ! G5) When will the next release appear? ---------- Section A: The Basics ! A1) What is it? Bash is a Unix command interpreter (shell). It is an implementation of *************** *** 119,142 **** of Case Western Reserve University. ! 2) What's the latest version? ! The latest version is 2.02, first made available on Monday, 20 April, 1998. ! 3) Where can I get it? Bash is the GNU project's shell, and so is available from the ! master GNU archive site, prep.ai.mit.edu, and its mirrors. The latest version is also available for FTP from ftp.cwru.edu. ! The following URLs tell how to get version 2.02: ! ftp://prep.ai.mit.edu/pub/gnu/bash-2.02.tar.gz ! ftp://ftp.cwru.edu/pub/bash/bash-2.02.tar.gz Formatted versions of the documentation are available with the URLs: ! ftp://prep.ai.mit.edu/pub/gnu/bash-doc-2.02.tar.gz ! ftp://ftp.cwru.edu/pub/bash/bash-doc-2.02.tar.gz ! 4) On what machines will bash run? Bash has been ported to nearly every version of UNIX. All you --- 119,142 ---- of Case Western Reserve University. ! A2) What's the latest version? ! The latest version is 2.03, first made available on Friday, 19 Feburary 1999. ! A3) Where can I get it? Bash is the GNU project's shell, and so is available from the ! master GNU archive site, ftp.gnu.org, and its mirrors. The latest version is also available for FTP from ftp.cwru.edu. ! The following URLs tell how to get version 2.03: ! ftp://ftp.gnu.org/pub/gnu/bash-2.03.tar.gz ! ftp://ftp.cwru.edu/pub/bash/bash-2.03.tar.gz Formatted versions of the documentation are available with the URLs: ! ftp://ftp.gnu.org/pub/gnu/bash-doc-2.03.tar.gz ! ftp://ftp.cwru.edu/pub/bash/bash-doc-2.03.tar.gz ! A4) On what machines will bash run? Bash has been ported to nearly every version of UNIX. All you *************** *** 148,155 **** More information appears in the file `INSTALL' in the distribution. ! 5) Will bash run on operating systems other than Unix? Configuration specifics for Unix-like systems such as QNX and ! LynxOS are included in the distribution. Bash-2.02 should compile and run on Minix 2.0 (patches were contributed), but I don't believe anyone has built bash-2.x on earlier Minix versions --- 148,155 ---- More information appears in the file `INSTALL' in the distribution. ! A5) Will bash run on operating systems other than Unix? Configuration specifics for Unix-like systems such as QNX and ! LynxOS are included in the distribution. Bash-2.03 should compile and run on Minix 2.0 (patches were contributed), but I don't believe anyone has built bash-2.x on earlier Minix versions *************** *** 163,172 **** http://www.cygnus.com/misc/gnu-win32 ! Cygnus has ported bash-1.14.7, and their port is part of the current ! gnu-win32 release. Cygnus has also done a port of bash-2.01 to the ! GNU-Win32 environment, and it should be available as part of their next ! release. ! Bash-2.02 should require no local Cygnus changes to build and run under GNU-WIN32. --- 163,172 ---- http://www.cygnus.com/misc/gnu-win32 ! Cygnus originally ported bash-1.14.7, and that port was part of their ! early GNU-Win32 releases. Cygnus has also done a port of bash-2.01 to the ! GNU-Win32 environment, and it is available as part of their current ! release. (They may have upgraded by now.) ! Bash-2.03 should require no local Cygnus changes to build and run under GNU-WIN32. *************** *** 176,182 **** ftp://ftp.gnustep.org//pub/win32/bash-alpha-nt-1.01.tar.gz ! Softway Systems has ported bash-2.01.1 to their Interix (nee OpenNT) system, a Unix subsystem for NT that replaces the Microsoft POSIX subsystem. Check out http://www.interix.com for more information. D. J. Delorie has ported bash-1.14.7 to run under MS-DOS, as part of --- 176,192 ---- ftp://ftp.gnustep.org//pub/win32/bash-alpha-nt-1.01.tar.gz ! Softway Systems has ported bash-2.01 to their Interix (nee OpenNT) system, a Unix subsystem for NT that replaces the Microsoft POSIX subsystem. Check out http://www.interix.com for more information. + Some support for Interix has been incorporated into bash, beginning + with Bash-2.03. It should be easier to build bash on Interix now, + but Interix users should fetch + + ftp://ftp.interix.com/pub/tw/unsup/bash.diffs.tar.gz + + and read the README.OpenNT file in that archive. It will detail the + arguments configure needs to build on Interix. A configure cache + file for Interix is in the bash distribution in cross-build/opennt.cache; + copy that to `config.cache' before starting configure. D. J. Delorie has ported bash-1.14.7 to run under MS-DOS, as part of *************** *** 202,211 **** distribution. Beware. ! 6) How can I build bash with gcc? Bash configures to use gcc by default if it is available. Read the file INSTALL in the distribution for more information. ! 7) How can I make bash my login shell? Some machines let you use `chsh' to change your login shell. Other --- 212,221 ---- distribution. Beware. ! A6) How can I build bash with gcc? Bash configures to use gcc by default if it is available. Read the file INSTALL in the distribution for more information. ! A7) How can I make bash my login shell? Some machines let you use `chsh' to change your login shell. Other *************** *** 253,257 **** code from ~/.profile to ~/.bash_profile. ! 8) I just changed my login shell to bash, and now I can't FTP into my machine. Why not? --- 263,267 ---- code from ~/.profile to ~/.bash_profile. ! A8) I just changed my login shell to bash, and now I can't FTP into my machine. Why not? *************** *** 263,267 **** such as `uucp' and `news' from using FTP. ! 9) What's the `POSIX 1003.2 standard'? POSIX is a name originally coined by Richard Stallman for a --- 273,277 ---- such as `uucp' and `news' from using FTP. ! A9) What's the `POSIX 1003.2 standard'? POSIX is a name originally coined by Richard Stallman for a *************** *** 298,302 **** objections. ! 10) What is the bash `posix mode'? Although bash is an implementation of the POSIX.2 shell --- 308,312 ---- objections. ! A10) What is the bash `posix mode'? Although bash is an implementation of the POSIX.2 shell *************** *** 315,321 **** Section B: The latest version ! 11) What's new in version 2.02? ! Bash-2.02 has a number of new features. Here's a short list: a new version of malloc (based on the old GNU malloc code in previous --- 325,351 ---- Section B: The latest version ! B1) What's new in version 2.03? ! ! Bash-2.03 has a very few new features, in keeping with the convention ! that odd-numbered releases provide mainly bug fixes. A number of new ! features were added to Readline, mostly at the request of the Cygnus ! folks. ! ! a new shopt option, `restricted_shell', so that startup files can test ! whether or not the shell was started in restricted mode ! filename generation is now performed on the words between ( and ) in ! compound array assignments (this is really a bug fix) ! OLDPWD is now auto-exported, as POSIX.2 requires ! ENV and BASH_ENV are read-only variables in a restricted shell ! Bash may now be linked against an already-installed Readline library, ! as long as the Readline library is version 4 or newer ! All shells begun with the `--login' option will source the login shell ! startup files, even if the shell is not interactive ! ! There are lots of changes to the version of the Readline library released ! along with Bash-2.03. For a complete list of the changes, read the file ! CHANGES in the Bash-2.03 distribution. ! Bash-2.02 contained the following new features: a new version of malloc (based on the old GNU malloc code in previous *************** *** 383,395 **** test suite greatly expanded ! 12) Are there any user-visible incompatibilities between bash-2.02 and bash-1.14.7? ! There are a few incompatibilities between version 1.14.7 and version 2.02. ! They are detailed in the file COMPAT in the bash-2.02 distribution. Section C: Differences from other Unix shells ! 13) How does bash differ from sh, the Bourne shell? This is a non-comprehensive list of features that differentiate bash --- 413,425 ---- test suite greatly expanded ! B2) Are there any user-visible incompatibilities between bash-2.03 and bash-1.14.7? ! There are a few incompatibilities between version 1.14.7 and version 2.03. ! They are detailed in the file COMPAT in the bash-2.03 distribution. Section C: Differences from other Unix shells ! C1) How does bash differ from sh, the Bourne shell? This is a non-comprehensive list of features that differentiate bash *************** *** 482,490 **** sh allows only a single option argument (`sh -x -v' attempts to open a file named `-v', and, on SunOS 4.1.4, dumps core. ! On Solaris 2, sh goes into an infinite loop.) sh exits a script if any builtin fails; bash exits only if one of the POSIX.2 `special' builtins fails ! 14) How does bash differ from the Korn shell, version ksh88? Things bash has or uses that ksh88 does not: --- 512,521 ---- sh allows only a single option argument (`sh -x -v' attempts to open a file named `-v', and, on SunOS 4.1.4, dumps core. ! On Solaris 2.4 and earlier versions, sh goes into an infinite ! loop.) sh exits a script if any builtin fails; bash exits only if one of the POSIX.2 `special' builtins fails ! C2) How does bash differ from the Korn shell, version ksh88? Things bash has or uses that ksh88 does not: *************** *** 542,548 **** bash command search finds functions before builtins ! 15) Which new features in ksh-93 are not in bash, and which are? ! New things in ksh-93 not in bash-2.02: associative arrays floating point arithmetic --- 573,579 ---- bash command search finds functions before builtins ! C3) Which new features in ksh-93 are not in bash, and which are? ! New things in ksh-93 not in bash-2.03: associative arrays floating point arithmetic *************** *** 565,569 **** `.' can execute shell functions ! New things in ksh-93 present in bash-2.02: ?: arithmetic operator expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]} --- 596,600 ---- `.' can execute shell functions ! New things in ksh-93 present in bash-2.03: ?: arithmetic operator expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]} *************** *** 589,602 **** Section D: Why does bash do some things differently than other Unix shells? ! 16) Why does bash run a different version of `command' than `which command' says it will? ! `which' is actually a csh script that assumes you're running csh. ! It reads the csh startup files from your home directory and uses ! those to determine which `command' will be invoked. Since bash ! doesn't use any of those startup files, there's a good chance ! that your bash environment differs from your csh environment. ! 17) Why doesn't bash treat brace expansions exactly like csh? The only difference between bash and csh brace expansion is that --- 620,654 ---- Section D: Why does bash do some things differently than other Unix shells? ! D1) Why does bash run a different version of `command' than `which command' says it will? ! On many systems, `which' is actually a csh script that assumes ! you're running csh. In tcsh, `which' and its cousin `where' ! are builtins. On other Unix systems, `which' is a perl script ! that uses the PATH environment variable. ! ! The csh script version reads the csh startup files from your ! home directory and uses those to determine which `command' will ! be invoked. Since bash doesn't use any of those startup files, ! there's a good chance that your bash environment differs from ! your csh environment. The bash `type' builtin does everything ! `which' does, and will report correct results for the running ! shell. If you're really wedded to the name `which', try adding ! the following function definition to your .bashrc: ! ! which() ! { ! builtin type -p "$@" ! } ! ! If you're moving from tcsh and would like to bring `where' along ! as well, use this function: ! where() ! { ! builtin type -a "$@" ! } ! ! D2) Why doesn't bash treat brace expansions exactly like csh? The only difference between bash and csh brace expansion is that *************** *** 609,613 **** Bash, ksh, zsh, and pd-ksh all implement brace expansion this way. ! 18) Why doesn't bash have csh variable modifiers? Posix has specified a more powerful, albeit somewhat more cryptic, --- 661,665 ---- Bash, ksh, zsh, and pd-ksh all implement brace expansion this way. ! D3) Why doesn't bash have csh variable modifiers? Posix has specified a more powerful, albeit somewhat more cryptic, *************** *** 664,668 **** ! 19) How can I make my csh aliases work when I convert to bash? Bash uses a different syntax to support aliases than csh does. --- 716,720 ---- ! D4) How can I make my csh aliases work when I convert to bash? Bash uses a different syntax to support aliases than csh does. *************** *** 707,711 **** environment. ! 20) How can I pipe standard output and standard error from one command to another, like csh does with `|&'? --- 759,763 ---- environment. ! D5) How can I pipe standard output and standard error from one command to another, like csh does with `|&'? *************** *** 717,721 **** descriptor 2. ! 21) Now that I've converted from ksh to bash, are there equivalents to ksh features like autoloaded functions and the `whence' command? --- 769,773 ---- descriptor 2. ! D6) Now that I've converted from ksh to bash, are there equivalents to ksh features like autoloaded functions and the `whence' command? *************** *** 736,740 **** things the way it does? ! 22) Why is the bash builtin `test' slightly different from /bin/test? The specific example used here is [ ! x -o x ], which is false. --- 788,792 ---- things the way it does? ! E1) Why is the bash builtin `test' slightly different from /bin/test? The specific example used here is [ ! x -o x ], which is false. *************** *** 765,769 **** As you can see, the test becomes (not (x or x)), which is false. ! 23) Why does bash sometimes say `Broken pipe'? If a sequence of commands appears in a pipeline, and one of the --- 817,821 ---- As you can see, the test becomes (not (x or x)), which is false. ! E2) Why does bash sometimes say `Broken pipe'? If a sequence of commands appears in a pipeline, and one of the *************** *** 780,784 **** SIGPIPE. ! 24) How can I get bash to read and display eight-bit characters? This is a process requiring several steps. --- 832,840 ---- SIGPIPE. ! You can build a version of bash that will not report SIGPIPE errors ! by uncommenting the definition of DONT_REPORT_SIGPIPE in the file ! config-top.h. ! ! E3) How can I get bash to read and display eight-bit characters? This is a process requiring several steps. *************** *** 814,818 **** in ~/.inputrc. ! 25) How do I write a function `x' to replace builtin command `x', but still invoke the command from within the function? --- 870,874 ---- in ~/.inputrc. ! E4) How do I write a function `x' to replace builtin command `x', but still invoke the command from within the function? *************** *** 835,839 **** the version above is marginally more efficient. ! 26) When I have terminal escape sequences in my prompt, why does bash wrap lines at the wrong column? --- 891,895 ---- the version above is marginally more efficient. ! E5) When I have terminal escape sequences in my prompt, why does bash wrap lines at the wrong column? *************** *** 851,858 **** and the \] escape to signal the end of such a sequence. ! 27) How can I find the value of a shell variable whose name is the value of another shell variable? ! Bash-2.02 supports this directly. You can use ${!var} --- 907,914 ---- and the \] escape to signal the end of such a sequence. ! E6) How can I find the value of a shell variable whose name is the value of another shell variable? ! Versions of Bash newer than Bash-2.0 support this directly. You can use ${!var} *************** *** 876,880 **** The expansion of the quoted portions of this expression will be deferred until `eval' runs, while the `$#' will be expanded ! before `eval' is executed. In bash-2.02, echo ${!#} --- 932,936 ---- The expansion of the quoted portions of this expression will be deferred until `eval' runs, while the `$#' will be expanded ! before `eval' is executed. In versions of bash later than bash-2.0, echo ${!#} *************** *** 882,886 **** does the same thing. ! 28) If I pipe the output of a command into `read variable', why doesn't the output show up in $variable when the read command finishes? --- 938,942 ---- does the same thing. ! E7) If I pipe the output of a command into `read variable', why doesn't the output show up in $variable when the read command finishes? *************** *** 938,942 **** set $IFS to a different value. ! 29) I have a bunch of shell scripts that use backslash-escaped characters in arguments to `echo'. Bash doesn't interpret these characters. Why not, and how can I make it understand them? --- 994,998 ---- set $IFS to a different value. ! E8) I have a bunch of shell scripts that use backslash-escaped characters in arguments to `echo'. Bash doesn't interpret these characters. Why not, and how can I make it understand them? *************** *** 958,962 **** type `make tests' to fail. ! 30) Why doesn't a while or for loop get suspended when I type ^Z? This is a consequence of how job control works on Unix. The only --- 1014,1018 ---- type `make tests' to fail. ! E9) Why doesn't a while or for loop get suspended when I type ^Z? This is a consequence of how job control works on Unix. The only *************** *** 973,978 **** may be stopped (and subsequently restarted) as a single unit. ! 31) How can I make the bash `time' reserved word print timing output that ! looks like the output from my system's /usr/bin/time? The bash command timing code looks for a variable `TIMEFORMAT' and --- 1029,1034 ---- may be stopped (and subsequently restarted) as a single unit. ! E10) How can I make the bash `time' reserved word print timing output that ! looks like the output from my system's /usr/bin/time? The bash command timing code looks for a variable `TIMEFORMAT' and *************** *** 1007,1011 **** Section F: Things to watch out for on certain Unix versions ! 32) Why can't I use command line editing in my `cmdtool'? The problem is `cmdtool' and bash fighting over the input. When --- 1063,1067 ---- Section F: Things to watch out for on certain Unix versions ! F1) Why can't I use command line editing in my `cmdtool'? The problem is `cmdtool' and bash fighting over the input. When *************** *** 1035,1039 **** in your bashrc file. ! 33) I built bash on Solaris 2. Why do globbing expansions and filename completion chop off the first few characters of each filename? --- 1091,1095 ---- in your bashrc file. ! F2) I built bash on Solaris 2. Why do globbing expansions and filename completion chop off the first few characters of each filename? *************** *** 1055,1059 **** /usr/ucb. ! 34) Why does bash dump core after I interrupt username completion or `~user' tilde expansion on a machine running NIS? --- 1111,1115 ---- /usr/ucb. ! F3) Why does bash dump core after I interrupt username completion or `~user' tilde expansion on a machine running NIS? *************** *** 1078,1082 **** the C library malloc and avoid the problem. ! 35) I'm running SVR4.2. Why is the line erased every time I type `@'? The `@' character is the default `line kill' character in most --- 1134,1138 ---- the C library malloc and avoid the problem. ! F4) I'm running SVR4.2. Why is the line erased every time I type `@'? The `@' character is the default `line kill' character in most *************** *** 1089,1093 **** where the `^' and `U' can be two separate characters. ! 36) Why does bash report syntax errors when my C News scripts use a redirection before a subshell command? --- 1145,1149 ---- where the `^' and `U' can be two separate characters. ! F5) Why does bash report syntax errors when my C News scripts use a redirection before a subshell command? *************** *** 1101,1105 **** `compound commands'. A redirection may only follow a compound command. ! The file CWRU/sh-redir-hack in the bash-2.02 distribution is an (unofficial) patch to parse.y that will modify the grammar to support this construct. It will not apply with `patch'; you must --- 1157,1161 ---- `compound commands'. A redirection may only follow a compound command. ! The file CWRU/sh-redir-hack in the bash-2.03 distribution is an (unofficial) patch to parse.y that will modify the grammar to support this construct. It will not apply with `patch'; you must *************** *** 1110,1114 **** Section G: Where do I go from here? ! 37) How do I report bugs in bash, and where should I look for fixes and advice? --- 1166,1170 ---- Section G: Where do I go from here? ! G1) How do I report bugs in bash, and where should I look for fixes and advice? *************** *** 1118,1122 **** information about your configuration and build environment. ! `bashbug' sends its reports to bug-bash@prep.ai.mit.edu, which is a large mailing list gatewayed to the usenet newsgroup gnu.bash.bug. --- 1174,1178 ---- information about your configuration and build environment. ! `bashbug' sends its reports to bug-bash@gnu.org, which is a large mailing list gatewayed to the usenet newsgroup gnu.bash.bug. *************** *** 1126,1132 **** To reach the bash maintainers directly, send mail to ! bash-maintainers@prep.ai.mit.edu. ! 38) What kind of bash documentation is there? First, look in the doc directory in the bash distribution. It should --- 1182,1188 ---- To reach the bash maintainers directly, send mail to ! bash-maintainers@gnu.org. ! G2) What kind of bash documentation is there? First, look in the doc directory in the bash distribution. It should *************** *** 1135,1147 **** bash.1 an extensive, thorough Unix-style manual page builtins.1 a manual page covering just bash builtin commands ! bashref.texi a reference manual in GNU info format ! bash.html an HTML version of the manual page ! bashref.html an HTML version of the reference manual FAQ this file article.ms text of an article written for The Linux Journal readline.3 a man page describing readline ! Postscript files created from the above source are available in ! the documentation distribution. There is additional documentation available for anonymous FTP from host --- 1191,1202 ---- bash.1 an extensive, thorough Unix-style manual page builtins.1 a manual page covering just bash builtin commands ! bashref.texi a reference manual in GNU tex`info format ! bashref.info an info version of the reference manual FAQ this file article.ms text of an article written for The Linux Journal readline.3 a man page describing readline ! Postscript, HTML, and ASCII files created from the above source are ! available in the documentation distribution. There is additional documentation available for anonymous FTP from host *************** *** 1159,1170 **** or on the web. ! 39) What's coming in future versions? These are features I plan to include in a future version of bash. a bash debugger (a minimally-tested version is included with bash-2.02) ! Programmable completion a la zsh ! 40) What's on the bash `wish list' for future versions? These are features that may or may not appear in a future version of bash. --- 1214,1225 ---- or on the web. ! G3) What's coming in future versions? These are features I plan to include in a future version of bash. a bash debugger (a minimally-tested version is included with bash-2.02) ! Programmable completion a la zsh/tcsh ! G4) What's on the bash `wish list' for future versions? These are features that may or may not appear in a future version of bash. *************** *** 1178,1189 **** arithmetic ++ and -- prefix and postfix operators date-stamped command history ! 41) When will the next release appear? ! The next version will appear sometime in 1998. Never make predictions. ! This document is Copyright 1995, 1996, 1998 by Chester Ramey. Permission is hereby granted, without written agreement and --- 1233,1247 ---- arithmetic ++ and -- prefix and postfix operators date-stamped command history + a way to bind readline editing key sequences to shell commands + a mechanism to open network connections and assign them to file descriptors + using redirection (like ksh /dev/{tcp,udp}) ! G5) When will the next release appear? ! The next version will appear sometime in 1999. Never make predictions. ! This document is Copyright 1995-1999 by Chester Ramey. Permission is hereby granted, without written agreement and diff -aNrc2 bash-2.02.1/doc/INTRO bash-2.03/doc/INTRO *** bash-2.02.1/doc/INTRO Mon Nov 18 12:30:44 1996 --- bash-2.03/doc/INTRO Wed Feb 17 16:13:42 1999 *************** *** 135,139 **** Help ! Bash includes a built-in help factility. Shell Optional Behavior --- 135,139 ---- Help ! Bash includes a built-in help facility. Shell Optional Behavior diff -aNrc2 bash-2.02.1/doc/Makefile.in bash-2.03/doc/Makefile.in *** bash-2.02.1/doc/Makefile.in Tue Mar 3 15:02:18 1998 --- bash-2.03/doc/Makefile.in Thu Feb 18 12:10:11 1999 *************** *** 1,4 **** --- 1,5 ---- # This Makefile is for the Bash/documentation directory -*- text -*-. # + SHELL = @MAKE_SHELL@ RM = rm -f *************** *** 85,93 **** nodvi: ps info text html ! ps: bash.ps bashbug.ps readline.ps article.ps builtins.ps ! dvi: bashref.dvi bashref.ps ! info: bashref.info ! text: bash.0 bashbug.0 builtins.0 readline.0 ! html: bashref.html bash.html bashref.dvi: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER) --- 86,100 ---- nodvi: ps info text html ! PSFILES = bash.ps bashbug.ps readline.ps article.ps builtins.ps ! DVIFILES = bashref.dvi bashref.ps ! INFOFILES = bashref.info ! MAN0FILES = bash.0 bashbug.0 builtins.0 readline.0 ! HTMLFILES = bashref.html bash.html ! ! ps: ${PSFILES} ! dvi: ${DVIFILES} ! info: ${INFOFILES} ! text: ${MAN0FILES} ! html: ${HTMLFILES} bashref.dvi: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER) *************** *** 102,106 **** bashref.html: bashref.texi $(HSUSER) $(RLUSER) ! $(TEXI2HTML) -I $(TEXINPUTDIR) $(srcdir)/bashref.texi bash.dvi: bash.texinfo $(HSUSER) $(RLUSER) --- 109,113 ---- bashref.html: bashref.texi $(HSUSER) $(RLUSER) ! $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi bash.dvi: bash.texinfo $(HSUSER) $(RLUSER) *************** *** 126,130 **** -( cd ${BUILD_DIR}/support ; ${MAKE} ${MFLAGS} man2html) ! faq: faq.news faq.news2 faq.mail faq.version faq.version: FAQ.version FAQ --- 133,139 ---- -( cd ${BUILD_DIR}/support ; ${MAKE} ${MFLAGS} man2html) ! CREATED_FAQ = faq.news faq.news2 faq.mail faq.version ! ! faq: ${CREATED_FAQ} faq.version: FAQ.version FAQ *************** *** 144,150 **** clean: ! $(RM) *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps \ ! *.pgs *.bt *.bts *.rw *.rws *.fns *.kys *.tps *.vrs *.o \ ! core rluser.texinfo hsuser.texinfo distclean mostlyclean: clean --- 153,159 ---- clean: ! $(RM) *.aux *.bak *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps \ ! *.pgs *.bt *.bts *.rw *.rws *.fns *.kys *.tps *.vrs *.o ! ${RM} core *.core distclean mostlyclean: clean *************** *** 152,156 **** maintainer-clean: clean ! $(RM) *.0 *.ps *.dvi *.info *.txt $(RM) Makefile --- 161,166 ---- maintainer-clean: clean ! ${RM} ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES} ! ${RM} ${CREATED_FAQ} $(RM) Makefile *************** *** 167,171 **** # -$(INSTALL_DATA) $(srcdir)/readline.3 $(man3dir)/readline.${man3ext} # uncomment the next line to install the builtins man page ! # $(INSTALL_DATA) builtins.1 $(man1dir)/bash_builtins.${man1ext} -$(INSTALL_DATA) $(srcdir)/bashref.info $(infodir)/bash.info # run install-info if it is present to update the info directory --- 177,181 ---- # -$(INSTALL_DATA) $(srcdir)/readline.3 $(man3dir)/readline.${man3ext} # uncomment the next line to install the builtins man page ! # $(INSTALL_DATA) $(srcdir)/builtins.1 $(man1dir)/bash_builtins.${man1ext} -$(INSTALL_DATA) $(srcdir)/bashref.info $(infodir)/bash.info # run install-info if it is present to update the info directory diff -aNrc2 bash-2.02.1/doc/README bash-2.03/doc/README *** bash-2.02.1/doc/README Fri Apr 12 11:19:02 1996 --- bash-2.03/doc/README Wed Feb 17 16:15:24 1999 *************** *** 2,10 **** FAQ - a set of frequently-asked questions about Bash with answers article.ms - an article I wrote about bash for The Linux Journal bash.1 - the bash man page builtins.1 - a man page that documents the builtins, extracted from bash.1 ! features.texi - the `bash reference manual' ! features.info - the `bash reference manual' processed by `makeinfo' readline.3 - the readline man page --- 2,11 ---- FAQ - a set of frequently-asked questions about Bash with answers + INTRO - a short introduction to bash article.ms - an article I wrote about bash for The Linux Journal bash.1 - the bash man page builtins.1 - a man page that documents the builtins, extracted from bash.1 ! bashref.texi - the `bash reference manual' ! bashref.info - the `bash reference manual' processed by `makeinfo' readline.3 - the readline man page diff -aNrc2 bash-2.02.1/doc/bash.1 bash-2.03/doc/bash.1 *** bash-2.02.1/doc/bash.1 Wed Apr 1 12:25:56 1998 --- bash-2.03/doc/bash.1 Wed Jan 20 16:48:04 1999 *************** *** 7,15 **** .\" chet@ins.CWRU.Edu .\" ! .\" Last Change: Wed Apr 1 12:16:09 EST 1998 .\" .\" bash_builtins, strip all but Built-Ins section .if \n(zZ=1 .ig zZ ! .TH BASH 1 "1998 Apr 1" GNU .\" .\" There's some problem with having a `@' --- 7,15 ---- .\" chet@ins.CWRU.Edu .\" ! .\" Last Change: Wed Jan 20 16:47:14 EST 1999 .\" .\" bash_builtins, strip all but Built-Ins section .if \n(zZ=1 .ig zZ ! .TH BASH 1 "1999 Jan 20" GNU .\" .\" There's some problem with having a `@' *************** *** 51,56 **** [file] .SH COPYRIGHT ! .if n Bash is Copyright (C) 1989, 1991, 1993, 1995, 1996 by the Free Software Foundation, Inc. ! .if t Bash is Copyright \(co 1989, 1991, 1993, 1995, 1996 by the Free Software Foundation, Inc. .SH DESCRIPTION .B Bash --- 51,56 ---- [file] .SH COPYRIGHT ! .if n Bash is Copyright (C) 1989-1999 by the Free Software Foundation, Inc. ! .if t Bash is Copyright \(co 1989-1999 by the Free Software Foundation, Inc. .SH DESCRIPTION .B Bash *************** *** 261,265 **** When .B bash ! is invoked as an interactive login shell, it first reads and executes commands from the file \fI/etc/profile\fP, if that file exists. --- 261,266 ---- When .B bash ! is invoked as an interactive login shell, or as a non-interactive shell ! with the \fB\-\-login\fP option, it first reads and executes commands from the file \fI/etc/profile\fP, if that file exists. *************** *** 314,318 **** as closely as possible, while conforming to the POSIX standard as well. ! When invoked as an interactive login shell, it first attempts to read and execute commands from .I /etc/profile --- 315,320 ---- as closely as possible, while conforming to the POSIX standard as well. ! When invoked as an interactive login shell, or a non-interactive ! shell with the \fB\-\-login\fP option, it first attempts to read and execute commands from .I /etc/profile *************** *** 339,343 **** A non-interactive shell invoked with the name .B sh ! does not attempt to read any startup files. When invoked as .BR sh , --- 341,345 ---- A non-interactive shell invoked with the name .B sh ! does not attempt to read any other startup files. When invoked as .BR sh , *************** *** 376,379 **** --- 378,389 ---- \fIrshd\fP does not generally invoke the shell with those options or allow them to be specified. + .PP + If the shell is started with the effective user (group) id not equal to the + real user (group) id, and the \fB\-p\fP option is not supplied, no startup + files are read, shell functions are not inherited from the environment, + the \fBSHELLOPTS\fP variable, if it appears in the environment, is ignored, + and the effective user id is set to the real user id. + If the \fB\-p\fP option is supplied at invocation, the startup behavior is + the same, but the effective user id is not reset. .SH DEFINITIONS .PP *************** *** 647,651 **** the entire conditional expression. .TP ! \fBfor\fP \fIname\fP [ \fBin\fP \fIword\fP; ] \fBdo\fP \fIlist\fP ; \fBdone\fP The list of words following \fBin\fP is expanded, generating a list of items. The variable \fIname\fP is set to each element of this list --- 657,661 ---- the entire conditional expression. .TP ! \fBfor\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fBdo\fP \fIlist\fP ; \fBdone\fP The list of words following \fBin\fP is expanded, generating a list of items. The variable \fIname\fP is set to each element of this list *************** *** 660,664 **** list, no commands are executed, and the return status is 0. .TP ! \fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP; ] \fBdo\fP \fIlist\fP ; \fBdone\fP The list of words following \fBin\fP is expanded, generating a list of items. The set of expanded words is printed on the standard --- 670,674 ---- list, no commands are executed, and the return status is 0. .TP ! \fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fBdo\fP \fIlist\fP ; \fBdone\fP The list of words following \fBin\fP is expanded, generating a list of items. The set of expanded words is printed on the standard *************** *** 2096,2102 **** replaced with \fIstring\fP. If \fIpattern\fP begins with \fB#\fP, it must match at the beginning ! of \fIstring\fP. If \fIpattern\fP begins with \fB%\fP, it must match at the end ! of \fIstring\fP. If \fIstring\fP is null, matches of \fIpattern\fP are deleted and the \fB/\fP following \fIpattern\fP may be omitted. --- 2106,2112 ---- replaced with \fIstring\fP. If \fIpattern\fP begins with \fB#\fP, it must match at the beginning ! of the expanded value of \fIparameter\fP. If \fIpattern\fP begins with \fB%\fP, it must match at the end ! of the expanded value of \fIparameter\fP. If \fIstring\fP is null, matches of \fIpattern\fP are deleted and the \fB/\fP following \fIpattern\fP may be omitted. *************** *** 2986,2989 **** --- 2996,3002 ---- True if \fIfile\fP exists and is set-group-id. .TP + .B \-h \fIfile\fP + True if \fIfile\fP exists and is a symbolic link. + .TP .B \-k \fIfile\fP True if \fIfile\fP exists and its ``sticky'' bit is set. *************** *** 4033,4036 **** --- 4046,4055 ---- is a synonym for this variable. .TP + .B isearch\-terminators (``C\-[C\-J'') + The string of characters that should terminate an incremental + search without subsequently executing the character as a command. + If this variable has not been given a value, the characters + \fIESC\fP and \fIC\-J\fP will terminate an incremental search. + .TP .B keymap (emacs) Set the current readline keymap. The set of valid keymap names is *************** *** 4160,4165 **** An incremental search requires only as many characters as needed to find the desired history entry. ! The Escape character is used to terminate an incremental search. ! Control-J will also terminate the search. Control-G will abort an incremental search and restore the original line. --- 4179,4186 ---- An incremental search requires only as many characters as needed to find the desired history entry. ! The characters present in the value of the \fIisearch-terminators\fP ! variable are used to terminate an incremental search. ! If that variable has not been assigned a value the Escape and ! Control-J characters will terminate an incremental search. Control-G will abort an incremental search and restore the original line. *************** *** 4342,4345 **** --- 4363,4371 ---- save the deleted text on the kill ring. .TP + .B forward\-backward\-delete\-char + Delete the character under the cursor, unless the cursor is at the + end of the line, in which case the character behind the cursor is + deleted. By default, this is not bound to a key. + .TP .B quoted\-insert (C\-q, C\-v) Add the next character typed to the line verbatim. This is *************** *** 4488,4491 **** --- 4514,4524 ---- by default. .TP + .B delete\-char\-or\-list + Deletes the character under the cursor if not at the beginning or + end of the line (like \fBdelete-char\fP). + If at the end of the line, behaves identically to + \fBpossible-completions\fP. + This command is unbound by default. + .TP .B complete\-filename (M\-/) Attempt filename completion on the text before point. *************** *** 4589,4593 **** command enough times to return the line to its initial state. .TP ! .B tilde\-expand (M\-~) Perform tilde expansion on the current word. .TP --- 4622,4626 ---- command enough times to return the line to its initial state. .TP ! .B tilde\-expand (M\-&) Perform tilde expansion on the current word. .TP *************** *** 6211,6214 **** --- 6244,6249 ---- .B IFS are used to split the line into words. + The backslash character (\fB\e\fP) may be used to remove any special + meaning for the next character read and for line continuation. Options, if supplied, have the following meanings: .RS *************** *** 6216,6221 **** .TP .B \-r ! A backslash-newline pair is not ignored, and ! the backslash is considered to be part of the line. .TP .B \-p --- 6251,6258 ---- .TP .B \-r ! Backslash does not act as an escape character. ! The backslash is considered to be part of the line. ! In particular, a backslash-newline pair may not be used as a line ! continuation. .TP .B \-p *************** *** 6488,6496 **** mode. In this mode, the .B $ENV ! file is not processed, shell functions are not inherited from the ! environment, and the variable ! The \fBSHELLOPTS\fP variable, if it appears in the environment, is ignored. ! This is enabled automatically on startup if the effective user (group) ! id is not equal to the real user (group) id. Turning this option off causes the effective user and group ids to be set to the real user and group ids. --- 6525,6538 ---- mode. In this mode, the .B $ENV ! and ! .B $BASH_ENV ! files are not processed, shell functions are not inherited from the ! environment, and the \fBSHELLOPTS\fP variable, if it appears in the ! environment, is ignored. ! If the shell is started with the effective user (group) id not equal to the ! real user (group) id, and the \fB\-p\fP option is not supplied, these actions ! are taken and the effective user id is set to the real user id. ! If the \fB\-p\fP option is supplied at startup, the effective user id is ! not reset. Turning this option off causes the effective user and group ids to be set to the real user and group ids. *************** *** 6795,6798 **** --- 6837,6849 ---- above. This option is enabled by default. .TP 8 + .B restricted_shell + The shell sets this option if it is started in restricted mode (see + .SM + .B "RESTRICTED SHELL" + below). + The value may not be changed. + This is not reset when the startup files are executed, allowing + the startup files to discover whether or not a shell is restricted. + .TP 8 .B shift_verbose If set, the *************** *** 7233,7239 **** .IP \(bu setting or unsetting the values of ! .B SHELL or ! .B PATH .IP \(bu specifying command names containing --- 7284,7292 ---- .IP \(bu setting or unsetting the values of ! .BR SHELL , ! .BR PATH , ! .BR ENV , or ! .B BASH_ENV .IP \(bu specifying command names containing *************** *** 7313,7316 **** --- 7366,7372 ---- .FN ~/.bashrc The individual per-interactive-shell startup file + .TP + .FN ~/.bash_logout + The individual login shell cleanup file, executed when a login shell exits .TP .FN ~/.inputrc diff -aNrc2 bash-2.02.1/doc/bashbug.1 bash-2.03/doc/bashbug.1 *** bash-2.02.1/doc/bashbug.1 Wed Aug 16 16:36:07 1995 --- bash-2.03/doc/bashbug.1 Thu Jul 30 16:22:49 1998 *************** *** 1,3 **** ! .TH BASHBUG 1 "1995 August 10" GNU .SH NAME bashbug \- report a bug in bash --- 1,3 ---- ! .TH BASHBUG 1 "1998 July 30" GNU .SH NAME bashbug \- report a bug in bash *************** *** 15,19 **** fill in the appropriate fields and exit the editor. .B bashbug ! then mails the completed report to \fIbug-bash@prep.ai.mit.edu\fP, or \fIaddress\fP. If the report cannot be mailed, it is saved in the file \fIdead.bashbug\fP in the invoking user's home directory. --- 15,19 ---- fill in the appropriate fields and exit the editor. .B bashbug ! then mails the completed report to \fIbug-bash@gnu.org\fP, or \fIaddress\fP. If the report cannot be mailed, it is saved in the file \fIdead.bashbug\fP in the invoking user's home directory. diff -aNrc2 bash-2.02.1/doc/bashref.info bash-2.03/doc/bashref.info *** bash-2.02.1/doc/bashref.info Thu Apr 2 16:53:42 1998 --- bash-2.03/doc/bashref.info Mon Feb 1 14:56:12 1999 *************** *** 10,18 **** the Bash shell. ! This is Edition 2.2, last updated 1 April 1998, of `The GNU Bash Reference Manual', ! for `Bash', Version 2.02. ! Copyright (C) 1991, 1993, 1996, 1997 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of --- 10,18 ---- the Bash shell. ! This is Edition 2.3, last updated 20 January 1999, of `The GNU Bash Reference Manual', ! for `Bash', Version 2.03. ! Copyright (C) 1991-1999 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of *************** *** 39,44 **** the Bash shell. ! This is Edition 2.2, last updated 1 April 1998, of `The GNU Bash ! Reference Manual', for `Bash', Version 2.02. Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc. --- 39,44 ---- the Bash shell. ! This is Edition 2.3, last updated 20 January 1999, of `The GNU Bash ! Reference Manual', for `Bash', Version 2.03. Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc. *************** *** 1233,1245 **** only the first match is replaced. The second form causes all matches of PATTERN to be replaced with STRING. If PATTERN begins ! with `#', it must match at the beginning of STRING. If PATTERN ! begins with `%', it must match at the end of STRING. If STRING is ! null, matches of PATTERN are deleted and the `/' following PATTERN ! may be omitted. If PARAMETER is `@' or `*', the substitution ! operation is applied to each positional parameter in turn, and the ! expansion is the resultant list. If PARAMETER is an array ! variable subscripted with `@' or `*', the substitution operation ! is applied to each member of the array in turn, and the expansion ! is the resultant list.  --- 1233,1246 ---- only the first match is replaced. The second form causes all matches of PATTERN to be replaced with STRING. If PATTERN begins ! with `#', it must match at the beginning of the expanded value of ! PARAMETER. If PATTERN begins with `%', it must match at the end ! of the expanded value of PARAMETER. If STRING is null, matches of ! PATTERN are deleted and the `/' following PATTERN may be omitted. ! If PARAMETER is `@' or `*', the substitution operation is applied ! to each positional parameter in turn, and the expansion is the ! resultant list. If PARAMETER is an array variable subscripted ! with `@' or `*', the substitution operation is applied to each ! member of the array in turn, and the expansion is the resultant ! list.  *************** *** 1983,1994 **** `.' ! . FILENAME Read and execute commands from the FILENAME argument in the current shell context. If FILENAME does not contain a slash, the `$PATH' variable is used to find FILENAME. The current directory ! is searched if FILENAME is not found in `$PATH'. The return ! status is the exit status of the last command executed, or zero if ! no commands are executed. If FILENAME is not found, or cannot be ! read, the return status is non-zero. `break' --- 1984,1997 ---- `.' ! . FILENAME [ARGUMENTS] Read and execute commands from the FILENAME argument in the current shell context. If FILENAME does not contain a slash, the `$PATH' variable is used to find FILENAME. The current directory ! is searched if FILENAME is not found in `$PATH'. If any ARGUMENTS ! are supplied, they become the positional parameters when FILENAME ! is executed. Otherwise the positional parameters are unchanged. ! The return status is the exit status of the last command executed, ! or zero if no commands are executed. If FILENAME is not found, or ! cannot be read, the return status is non-zero. `break' *************** *** 2763,2768 **** (*note Tilde Expansion::.). ! When Bash is invoked as an interactive login shell, it first reads ! and executes commands from the file `/etc/profile', if that file exists. After reading that file, it looks for `~/.bash_profile', `~/.bash_login', and `~/.profile', in that order, and reads and --- 2766,2772 ---- (*note Tilde Expansion::.). ! When Bash is invoked as an interactive login shell, or as a ! non-interactive shell with the `--login' option, it first reads and ! executes commands from the file `/etc/profile', if that file exists. After reading that file, it looks for `~/.bash_profile', `~/.bash_login', and `~/.profile', in that order, and reads and *************** *** 2799,2812 **** conforming to the POSIX standard as well. ! When invoked as an interactive login shell, it first attempts to read ! and execute commands from `/etc/profile' and `~/.profile', in that ! order. The `--noprofile' option may be used to inhibit this behavior. ! When invoked as an interactive shell with the name `sh', Bash looks for ! the variable `ENV', expands its value if it is defined, and uses the expanded value as the name of a file to read and execute. Since a shell invoked as `sh' does not attempt to read and execute commands from any other startup files, the `--rcfile' option has no effect. A non-interactive shell invoked with the name `sh' does not attempt to ! read any startup files. When invoked as `sh', Bash enters POSIX mode after the startup files --- 2803,2817 ---- conforming to the POSIX standard as well. ! When invoked as an interactive login shell, or as a non-interactive ! shell with the `--login' option, it first attempts to read and execute ! commands from `/etc/profile' and `~/.profile', in that order. The ! `--noprofile' option may be used to inhibit this behavior. When ! invoked as an interactive shell with the name `sh', Bash looks for the ! variable `ENV', expands its value if it is defined, and uses the expanded value as the name of a file to read and execute. Since a shell invoked as `sh' does not attempt to read and execute commands from any other startup files, the `--rcfile' option has no effect. A non-interactive shell invoked with the name `sh' does not attempt to ! read any other startup files. When invoked as `sh', Bash enters POSIX mode after the startup files *************** *** 2828,2831 **** --- 2833,2844 ---- specified. + If Bash is started with the effective user (group) id not equal to + the real user (group) id, and the `-p' option is not supplied, no + startup files are read, shell functions are not inherited from the + environment, the `SHELLOPTS' variable, if it appears in the + environment, is ignored, and the effective user id is set to the real + user id. If the `-p' option is supplied at invocation, the startup + behavior is the same, but the effective user id is not reset. +  File: bashref.info, Node: Is This Shell Interactive?, Next: Bash Builtins, Prev: Bash Startup Files, Up: Bash Features *************** *** 3127,3131 **** standard input than names, the remaining names are assigned empty values. The characters in the value of the `IFS' variable are ! used to split the line into words. If no names are supplied, the line read is assigned to the variable `REPLY'. The return code is zero, unless end-of-file is encountered. Options, if supplied, --- 3140,3146 ---- standard input than names, the remaining names are assigned empty values. The characters in the value of the `IFS' variable are ! used to split the line into words. The backslash character `\' ! may be used to remove any special meaning for the next character ! read and for line continuation. If no names are supplied, the line read is assigned to the variable `REPLY'. The return code is zero, unless end-of-file is encountered. Options, if supplied, *************** *** 3133,3139 **** `-r' ! If this option is given, a backslash-newline pair is not ! ignored, and the backslash is considered to be part of the ! line. `-p PROMPT' --- 3148,3155 ---- `-r' ! If this option is given, backslash does not act as an escape ! character. The backslash is considered to be part of the ! line. In particular, a backslash-newline pair may not be ! used as a line continuation. `-p PROMPT' *************** *** 3288,3291 **** --- 3304,3314 ---- This option is enabled by default. + `restricted_shell' + The shell sets this option if it is started in restricted mode + (*note The Restricted Shell::.). The value may not be + changed. This is not reset when the startup files are + executed, allowing the startup files to discover whether or + not a shell is restricted. + `shift_verbose' If this is set, the `shift' builtin prints an error message *************** *** 3528,3536 **** `$ENV' files are not processed, shell functions are not inherited from the environment, and the `SHELLOPTS' variable, ! if it appears in the environment, is ignored. This is ! enabled automatically on startup if the effective user ! (group) id is not equal to the real user (group) id. Turning ! this option off causes the effective user and group ids to be ! set to the real user and group ids. `-t' --- 3551,3562 ---- `$ENV' files are not processed, shell functions are not inherited from the environment, and the `SHELLOPTS' variable, ! if it appears in the environment, is ignored. If the shell ! is started with the effective user (group) id not equal to the ! real user (group) id, and the `-p' option is not supplied, ! these actions are taken and the effective user id is set to ! the real user id. If the `-p' option is supplied at startup, ! the effective user id is not reset. Turning this option off ! causes the effective user and group ids to be set to the real ! user and group ids. `-t' *************** *** 3641,3644 **** --- 3667,3673 ---- True if FILE exists and its set-group-id bit is set. + `-h FILE' + True if FILE exists and is a symbolic link. + `-k FILE' True if FILE exists and its "sticky" bit is set. *************** *** 4451,4455 **** * Changing directories with the `cd' builtin. ! * Setting or unsetting the values of the `SHELL' or `PATH' variables. * Specifying command names containing slashes. --- 4480,4485 ---- * Changing directories with the `cd' builtin. ! * Setting or unsetting the values of the `SHELL', `PATH', `ENV', or ! `BASH_ENV' variables. * Specifying command names containing slashes. *************** *** 5347,5362 **** Readline displays the next entry from the history matching the string typed so far. An incremental search requires only as many characters ! as needed to find the desired history entry. The character is ! used to terminate an incremental search. will also terminate the ! search. will abort an incremental search and restore the ! original line. When the search is terminated, the history entry ! containing the search string becomes the current line. To find other ! matching entries in the history list, type or as ! appropriate. This will search backward or forward in the history for ! the next entry matching the search string typed so far. Any other key ! sequence bound to a Readline command will terminate the search and ! execute that command. For instance, a will terminate the search ! and accept the line, thereby executing the command from the history ! list. Non-incremental searches read the entire search string before --- 5377,5393 ---- Readline displays the next entry from the history matching the string typed so far. An incremental search requires only as many characters ! as needed to find the desired history entry. The characters present in ! the value of the ISEARCH-TERMINATORS variable are used to terminate an ! incremental search. If that variable has not been assigned a value, ! the and characters will terminate an incremental search. ! will abort an incremental search and restore the original line. ! When the search is terminated, the history entry containing the search ! string becomes the current line. To find other matching entries in the ! history list, type or as appropriate. This will search ! backward or forward in the history for the next entry matching the ! search string typed so far. Any other key sequence bound to a Readline ! command will terminate the search and execute that command. For ! instance, a will terminate the search and accept the line, ! thereby executing the command from the history list. Non-incremental searches read the entire search string before *************** *** 5472,5475 **** --- 5503,5520 ---- a new screen line. By default, this variable is set to `off'. + `input-meta' + If set to `on', Readline will enable eight-bit input (it will + not strip the eighth bit from the characters it reads), + regardless of what the terminal claims it can support. The + default value is `off'. The name `meta-flag' is a synonym + for this variable. + + `isearch-terminators' + The string of characters that should terminate an incremental + search without subsequently executing the character as a + command (*note Searching::.). If this variable has not been + given a value, the characters and will terminate + an incremental search. + `keymap' Sets Readline's idea of the current keymap for key binding *************** *** 5490,5500 **** modified. This variable is `off' by default. - `input-meta' - If set to `on', Readline will enable eight-bit input (it will - not strip the eighth bit from the characters it reads), - regardless of what the terminal claims it can support. The - default value is `off'. The name `meta-flag' is a synonym - for this variable. - `output-meta' If set to `on', Readline will display characters with the --- 5535,5538 ---- *************** *** 5930,5933 **** --- 5968,5976 ---- to kill the characters instead of deleting them. + `forward-backward-delete-char ()' + Delete the character under the cursor, unless the cursor is at the + end of the line, in which case the character behind the cursor is + deleted. By default, this is not bound to a key. + `quoted-insert (C-q, C-v)' Add the next character typed to the line verbatim. This is how to *************** *** 6084,6087 **** --- 6127,6136 ---- default. + `delete-char-or-list ()' + Deletes the character under the cursor if not at the beginning or + end of the line (like `delete-char'). If at the end of the line, + behaves identically to `possible-completions'. This command is + unbound by default. + `complete-filename (M-/)' Attempt filename completion on the text before point. *************** *** 6181,6185 **** `undo' command enough times to get back to the beginning. ! `tilde-expand (M-~)' Perform tilde expansion on the current word. --- 6230,6234 ---- `undo' command enough times to get back to the beginning. ! `tilde-expand (M-&)' Perform tilde expansion on the current word. *************** *** 6563,6566 **** --- 6612,6620 ---- option automatically for a number of systems. + `--with-installed-readline' + Define this to make bash link with a locally-installed version of + Readline rather than the version in lib/readline. This works only + with readline 4.0 and later versions. + `--with-purify' Define this to use the Purify memory allocation checker from Pure *************** *** 6858,6861 **** --- 6912,6916 ---- * input-meta: Readline Init File Syntax. * INPUTRC: Bash Variables. + * isearch-terminators: Readline Init File Syntax. * keymap: Readline Init File Syntax. * LANG: Bash Variables. *************** *** 6924,6927 **** --- 6979,6983 ---- * copy-region-as-kill (): Commands For Killing. * delete-char (C-d): Commands For Text. + * delete-char-or-list (): Commands For Completion. * delete-horizontal-space (): Commands For Killing. * digit-argument (M-0, M-1, ... M--): Numeric Arguments. *************** *** 6935,6938 **** --- 6991,6995 ---- * end-of-line (C-e): Commands For Moving. * exchange-point-and-mark (C-x C-x): Miscellaneous Commands. + * forward-backward-delete-char (): Commands For Text. * forward-char (C-f): Commands For Moving. * forward-search-history (C-s): Commands For History. *************** *** 6961,6965 **** * set-mark (C-@): Miscellaneous Commands. * start-kbd-macro (C-x (): Keyboard Macros. - * tilde-expand (M-~): Miscellaneous Commands. * transpose-chars (C-t): Commands For Text. * transpose-words (M-t): Commands For Text. --- 7018,7021 ---- *************** *** 7093,7211 ****  Tag Table: ! Node: Top1197 ! Node: Introduction3153 ! Node: What is Bash?3378 ! Node: What is a shell?4472 ! Node: Definitions6494 ! Node: Basic Shell Features9155 ! Node: Shell Syntax10378 ! Node: Shell Operation10667 ! Node: Quoting11961 ! Node: Escape Character12986 ! Node: Single Quotes13458 ! Node: Double Quotes13787 ! Node: ANSI-C Quoting14685 ! Node: Locale Translation15554 ! Node: Comments15975 ! Node: Shell Commands16589 ! Node: Simple Commands17100 ! Node: Pipelines17659 ! Node: Lists19186 ! Node: Looping Constructs20641 ! Node: Conditional Constructs22246 ! Node: Command Grouping28184 ! Node: Shell Functions29561 ! Node: Shell Parameters31525 ! Node: Positional Parameters32851 ! Node: Special Parameters33600 ! Node: Shell Expansions36221 ! Node: Brace Expansion38144 ! Node: Tilde Expansion39705 ! Node: Shell Parameter Expansion42037 ! Node: Command Substitution48379 ! Node: Arithmetic Expansion49653 ! Node: Process Substitution50498 ! Node: Word Splitting51392 ! Node: Filename Expansion52844 ! Node: Pattern Matching54808 ! Node: Quote Removal57197 ! Node: Redirections57483 ! Node: Executing Commands63553 ! Node: Simple Command Expansion64220 ! Node: Command Search and Execution66143 ! Node: Command Execution Environment68146 ! Node: Environment70600 ! Node: Exit Status72257 ! Node: Signals73454 ! Node: Shell Scripts75349 ! Node: Bourne Shell Features77385 ! Node: Bourne Shell Builtins78115 ! Node: Bourne Shell Variables92056 ! Node: Other Bourne Shell Features93761 ! Node: Major Differences From The Bourne Shell94504 ! Node: Bash Features106693 ! Node: Invoking Bash107796 ! Node: Bash Startup Files111981 ! Node: Is This Shell Interactive?115540 ! Node: Bash Builtins116511 ! Node: The Set Builtin137351 ! Node: Bash Conditional Expressions143960 ! Node: Bash Variables147033 ! Node: Shell Arithmetic159463 ! Node: Aliases161511 ! Node: Alias Builtins164086 ! Node: Arrays164702 ! Node: The Directory Stack167723 ! Node: Printing a Prompt171073 ! Node: The Restricted Shell172736 ! Node: Bash POSIX Mode174072 ! Node: Job Control178233 ! Node: Job Control Basics178699 ! Node: Job Control Builtins182898 ! Node: Job Control Variables187190 ! Node: Using History Interactively188340 ! Node: Bash History Facilities189019 ! Node: Bash History Builtins191360 ! Node: History Interaction194728 ! Node: Event Designators197280 ! Node: Word Designators198207 ! Node: Modifiers199456 ! Node: Command Line Editing200773 ! Node: Introduction and Notation201433 ! Node: Readline Interaction202471 ! Node: Readline Bare Essentials203663 ! Node: Readline Movement Commands205203 ! Node: Readline Killing Commands206168 ! Node: Readline Arguments207883 ! Node: Searching208857 ! Node: Readline Init File210475 ! Node: Readline Init File Syntax211514 ! Node: Conditional Init Constructs220379 ! Node: Sample Init File222817 ! Node: Bindable Readline Commands225986 ! Node: Commands For Moving226736 ! Node: Commands For History227583 ! Node: Commands For Text230412 ! Node: Commands For Killing232146 ! Node: Numeric Arguments234295 ! Node: Commands For Completion235421 ! Node: Keyboard Macros238991 ! Node: Miscellaneous Commands239549 ! Node: Readline vi Mode243869 ! Node: Installing Bash244747 ! Node: Basic Installation245824 ! Node: Compilers and Options248734 ! Node: Compiling For Multiple Architectures249468 ! Node: Installation Names251125 ! Node: Specifying the System Type251850 ! Node: Sharing Defaults252554 ! Node: Operation Controls253219 ! Node: Optional Features254124 ! Node: Reporting Bugs260319 ! Node: Builtin Index261390 ! Node: Reserved Word Index264793 ! Node: Variable Index266251 ! Node: Function Index271456 ! Node: Concept Index275885  End Tag Table --- 7149,7267 ----  Tag Table: ! Node: Top1187 ! Node: Introduction3146 ! Node: What is Bash?3371 ! Node: What is a shell?4465 ! Node: Definitions6487 ! Node: Basic Shell Features9148 ! Node: Shell Syntax10371 ! Node: Shell Operation10660 ! Node: Quoting11954 ! Node: Escape Character12979 ! Node: Single Quotes13451 ! Node: Double Quotes13780 ! Node: ANSI-C Quoting14678 ! Node: Locale Translation15547 ! Node: Comments15968 ! Node: Shell Commands16582 ! Node: Simple Commands17093 ! Node: Pipelines17652 ! Node: Lists19179 ! Node: Looping Constructs20634 ! Node: Conditional Constructs22239 ! Node: Command Grouping28177 ! Node: Shell Functions29554 ! Node: Shell Parameters31518 ! Node: Positional Parameters32844 ! Node: Special Parameters33593 ! Node: Shell Expansions36214 ! Node: Brace Expansion38137 ! Node: Tilde Expansion39698 ! Node: Shell Parameter Expansion42030 ! Node: Command Substitution48426 ! Node: Arithmetic Expansion49700 ! Node: Process Substitution50545 ! Node: Word Splitting51439 ! Node: Filename Expansion52891 ! Node: Pattern Matching54855 ! Node: Quote Removal57244 ! Node: Redirections57530 ! Node: Executing Commands63600 ! Node: Simple Command Expansion64267 ! Node: Command Search and Execution66190 ! Node: Command Execution Environment68193 ! Node: Environment70647 ! Node: Exit Status72304 ! Node: Signals73501 ! Node: Shell Scripts75396 ! Node: Bourne Shell Features77432 ! Node: Bourne Shell Builtins78162 ! Node: Bourne Shell Variables92273 ! Node: Other Bourne Shell Features93978 ! Node: Major Differences From The Bourne Shell94721 ! Node: Bash Features106910 ! Node: Invoking Bash108013 ! Node: Bash Startup Files112198 ! Node: Is This Shell Interactive?116342 ! Node: Bash Builtins117313 ! Node: The Set Builtin138717 ! Node: Bash Conditional Expressions145533 ! Node: Bash Variables148666 ! Node: Shell Arithmetic161096 ! Node: Aliases163144 ! Node: Alias Builtins165719 ! Node: Arrays166335 ! Node: The Directory Stack169356 ! Node: Printing a Prompt172706 ! Node: The Restricted Shell174369 ! Node: Bash POSIX Mode175730 ! Node: Job Control179891 ! Node: Job Control Basics180357 ! Node: Job Control Builtins184556 ! Node: Job Control Variables188848 ! Node: Using History Interactively189998 ! Node: Bash History Facilities190677 ! Node: Bash History Builtins193018 ! Node: History Interaction196386 ! Node: Event Designators198938 ! Node: Word Designators199865 ! Node: Modifiers201114 ! Node: Command Line Editing202431 ! Node: Introduction and Notation203091 ! Node: Readline Interaction204129 ! Node: Readline Bare Essentials205321 ! Node: Readline Movement Commands206861 ! Node: Readline Killing Commands207826 ! Node: Readline Arguments209541 ! Node: Searching210515 ! Node: Readline Init File212263 ! Node: Readline Init File Syntax213302 ! Node: Conditional Init Constructs222508 ! Node: Sample Init File224946 ! Node: Bindable Readline Commands228115 ! Node: Commands For Moving228865 ! Node: Commands For History229712 ! Node: Commands For Text232541 ! Node: Commands For Killing234508 ! Node: Numeric Arguments236657 ! Node: Commands For Completion237783 ! Node: Keyboard Macros241615 ! Node: Miscellaneous Commands242173 ! Node: Readline vi Mode246493 ! Node: Installing Bash247371 ! Node: Basic Installation248448 ! Node: Compilers and Options251358 ! Node: Compiling For Multiple Architectures252092 ! Node: Installation Names253749 ! Node: Specifying the System Type254474 ! Node: Sharing Defaults255178 ! Node: Operation Controls255843 ! Node: Optional Features256748 ! Node: Reporting Bugs263158 ! Node: Builtin Index264229 ! Node: Reserved Word Index267632 ! Node: Variable Index269090 ! Node: Function Index274363 ! Node: Concept Index278853  End Tag Table diff -aNrc2 bash-2.02.1/doc/bashref.texi bash-2.03/doc/bashref.texi *** bash-2.02.1/doc/bashref.texi Wed Apr 1 13:17:06 1998 --- bash-2.03/doc/bashref.texi Wed Jan 20 16:47:01 1999 *************** *** 6,16 **** @ignore ! last change: Wed Mar 25 11:36:48 EST 1998 @end ignore ! @set EDITION 2.2 ! @set VERSION 2.02 ! @set UPDATED 1 April 1998 ! @set UPDATE-MONTH April 1998 @iftex --- 6,16 ---- @ignore ! Last Change: Wed Jan 20 16:46:26 EST 1999 @end ignore ! @set EDITION 2.3 ! @set VERSION 2.03 ! @set UPDATED 20 January 1999 ! @set UPDATE-MONTH January 1999 @iftex *************** *** 37,41 **** for @code{Bash}, Version @value{VERSION}. ! Copyright (C) 1991, 1993, 1996, 1997 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of --- 37,41 ---- for @code{Bash}, Version @value{VERSION}. ! Copyright (C) 1991-1999 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of *************** *** 65,75 **** @title Bash Reference Manual @subtitle Reference Documentation for Bash ! @subtitle Edition @value{EDITION}, for @code{bash} Version @value{VERSION}. ! @subtitle @value{UPDATED} @author Chet Ramey, Case Western Reserve University @author Brian Fox, Free Software Foundation @page @vskip 0pt plus 1filll ! Copyright @copyright{} 1991, 1993, 1996 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of --- 65,75 ---- @title Bash Reference Manual @subtitle Reference Documentation for Bash ! @subtitle Edition @value{EDITION}, for @code{Bash} Version @value{VERSION}. ! @subtitle @value{UPDATE-MONTH} @author Chet Ramey, Case Western Reserve University @author Brian Fox, Free Software Foundation @page @vskip 0pt plus 1filll ! Copyright @copyright{} 1991-1999 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of *************** *** 1429,1435 **** replaced with @var{string}. If @var{pattern} begins with @samp{#}, it must match at the beginning ! of @var{string}. If @var{pattern} begins with @samp{%}, it must match at the end ! of @var{string}. If @var{string} is null, matches of @var{pattern} are deleted and the @code{/} following @var{pattern} may be omitted. --- 1429,1435 ---- replaced with @var{string}. If @var{pattern} begins with @samp{#}, it must match at the beginning ! of the expanded value of @var{parameter}. If @var{pattern} begins with @samp{%}, it must match at the end ! of the expanded value of @var{parameter}. If @var{string} is null, matches of @var{pattern} are deleted and the @code{/} following @var{pattern} may be omitted. *************** *** 2286,2290 **** @btindex . @example ! . @var{filename} @end example Read and execute commands from the @var{filename} argument in the --- 2286,2290 ---- @btindex . @example ! . @var{filename} [@var{arguments}] @end example Read and execute commands from the @var{filename} argument in the *************** *** 2293,2296 **** --- 2293,2299 ---- @var{filename}. The current directory is searched if @var{filename} is not found in @code{$PATH}. + If any @var{arguments} are supplied, they become the positional + parameters when @var{filename} is executed. Otherwise the positional + parameters are unchanged. The return status is the exit status of the last command executed, or zero if no commands are executed. If @var{filename} is not found, or *************** *** 3246,3250 **** Tilde Expansion (@pxref{Tilde Expansion}). ! When Bash is invoked as an interactive login shell, it first reads and executes commands from the file @file{/etc/profile}, if that file exists. After reading that file, it looks for @file{~/.bash_profile}, --- 3249,3254 ---- Tilde Expansion (@pxref{Tilde Expansion}). ! When Bash is invoked as an interactive login shell, or as a ! non-interactive shell with the @samp{--login} option, it first reads and executes commands from the file @file{/etc/profile}, if that file exists. After reading that file, it looks for @file{~/.bash_profile}, *************** *** 3286,3290 **** possible, while conforming to the @sc{POSIX} standard as well. ! When invoked as an interactive login shell, it first attempts to read and execute commands from @file{/etc/profile} and @file{~/.profile}, in that order. --- 3290,3295 ---- possible, while conforming to the @sc{POSIX} standard as well. ! When invoked as an interactive login shell, or as a non-interactive ! shell with the @samp{--login} option, it first attempts to read and execute commands from @file{/etc/profile} and @file{~/.profile}, in that order. *************** *** 3297,3301 **** no effect. A non-interactive shell invoked with the name @code{sh} does not attempt ! to read any startup files. When invoked as @code{sh}, Bash enters @sc{POSIX} mode after --- 3302,3306 ---- no effect. A non-interactive shell invoked with the name @code{sh} does not attempt ! to read any other startup files. When invoked as @code{sh}, Bash enters @sc{POSIX} mode after *************** *** 3320,3323 **** --- 3325,3336 ---- allow them to be specified. + If Bash is started with the effective user (group) id not equal to the + real user (group) id, and the @code{-p} option is not supplied, no startup + files are read, shell functions are not inherited from the environment, + the @code{SHELLOPTS} variable, if it appears in the environment, is ignored, + and the effective user id is set to the real user id. + If the @code{-p} option is supplied at invocation, the startup behavior is + the same, but the effective user id is not reset. + @node Is This Shell Interactive? @section Is This Shell Interactive? *************** *** 3677,3680 **** --- 3690,3695 ---- The characters in the value of the @code{IFS} variable are used to split the line into words. + The backslash character @samp{\} may be used to remove any special + meaning for the next character read and for line continuation. If no names are supplied, the line read is assigned to the variable @code{REPLY}. *************** *** 3684,3689 **** @table @code @item -r ! If this option is given, a backslash-newline pair is not ignored, and ! the backslash is considered to be part of the line. @item -p @var{prompt} --- 3699,3706 ---- @table @code @item -r ! If this option is given, backslash does not act as an escape ! character. The backslash is considered to be part of the line. ! In particular, a backslash-newline pair may not be used as a line ! continuation. @item -p @var{prompt} *************** *** 3854,3857 **** --- 3871,3881 ---- This option is enabled by default. + @item restricted_shell + The shell sets this option if it is started in restricted mode + (@pxref{The Restricted Shell}). + The value may not be changed. + This is not reset when the startup files are executed, allowing + the startup files to discover whether or not a shell is restricted. + @item shift_verbose If this is set, the @code{shift} *************** *** 4121,4127 **** and the @code{SHELLOPTS} variable, if it appears in the environment, is ignored. ! This is enabled automatically ! on startup if the effective user (group) id is not equal to the real ! user (group) id. Turning this option off causes the effective user and group ids to be set to the real user and group ids. --- 4145,4154 ---- and the @code{SHELLOPTS} variable, if it appears in the environment, is ignored. ! If the shell is started with the effective user (group) id not equal to the ! real user (group) id, and the @code{-p} option is not supplied, these actions ! are taken and the effective user id is set to the real user id. ! If the @code{-p} option is supplied at startup, the effective user id is ! not reset. ! Turning this option off causes the effective user and group ids to be set to the real user and group ids. *************** *** 4236,4239 **** --- 4263,4269 ---- True if @var{file} exists and its set-group-id bit is set. + @item -h @var{file} + True if @var{file} exists and is a symbolic link. + @item -k @var{file} True if @var{file} exists and its "sticky" bit is set. *************** *** 5102,5107 **** Changing directories with the @code{cd} builtin. @item ! Setting or unsetting the values of the @code{SHELL} or @code{PATH} ! variables. @item Specifying command names containing slashes. --- 5132,5137 ---- Changing directories with the @code{cd} builtin. @item ! Setting or unsetting the values of the @code{SHELL}, @code{PATH}, ! @code{ENV}, or @code{BASH_ENV} variables. @item Specifying command names containing slashes. *************** *** 5815,5818 **** --- 5845,5853 ---- which this should be turned off, and @code{configure} disables this option automatically for a number of systems. + + @item --with-installed-readline + Define this to make bash link with a locally-installed version of Readline + rather than the version in lib/readline. This works only with readline 4.0 + and later versions. @item --with-purify diff -aNrc2 bash-2.02.1/doc/readline.3 bash-2.03/doc/readline.3 *** bash-2.02.1/doc/readline.3 Thu Feb 19 10:26:51 1998 --- bash-2.03/doc/readline.3 Thu Dec 31 10:16:52 1998 *************** *** 7,13 **** .\" chet@ins.CWRU.Edu .\" ! .\" Last Change: Thu Feb 19 10:26:47 EST 1998 .\" ! .TH READLINE 3 "1998 Feb 19" GNU .\" .\" File Name macro. This used to be `.PN', for Path Name, --- 7,13 ---- .\" chet@ins.CWRU.Edu .\" ! .\" Last Change: Thu Dec 31 10:16:30 EST 1998 .\" ! .TH READLINE 3 "1998 Dec 31" GNU .\" .\" File Name macro. This used to be `.PN', for Path Name, *************** *** 23,26 **** --- 23,27 ---- .nf .ft B + #include #include #include *************** *** 381,384 **** --- 382,398 ---- becomes longer than the screen width rather than wrapping to a new line. .TP + .B input\-meta (Off) + If set to \fBOn\fP, readline will enable eight-bit input (that is, + it will not strip the high bit from the characters it reads), + regardless of what the terminal claims it can support. The name + .B meta\-flag + is a synonym for this variable. + .TP + .B isearch\-terminators (``C\-[C\-J'') + The string of characters that should terminate an incremental + search without subsequently executing the character as a command. + If this variable has not been given a value, the characters + \fIESC\fP and \fIC\-J\fP will terminate an incremental search. + .TP .B keymap (emacs) Set the current readline keymap. The set of legal keymap names is *************** *** 401,409 **** with a preceding asterisk (\fB*\fP). .TP - .B meta\-flag (Off) - If set to \fBOn\fP, readline will enable eight-bit input (that is, - it will not strip the high bit from the characters it reads), - regardless of what the terminal claims it can support. - .TP .B output\-meta (Off) If set to \fBOn\fP, readline will display characters with the --- 415,418 ---- *************** *** 510,515 **** An incremental search requires only as many characters as needed to find the desired history entry. ! The Escape character is used to terminate an incremental search. ! Control-J will also terminate the search. Control-G will abort an incremental search and restore the original line. --- 519,526 ---- An incremental search requires only as many characters as needed to find the desired history entry. ! The characters present in the value of the \fIisearch-terminators\fP ! variable are used to terminate an incremental search. ! If that variable has not been assigned a value the Escape and ! Control-J characters will terminate an incremental search. Control-G will abort an incremental search and restore the original line. *************** *** 648,651 **** --- 659,667 ---- save the deleted text on the kill ring. .TP + .B forward\-backward\-delete\-char + Delete the character under the cursor, unless the cursor is at the + end of the line, in which case the character behind the cursor is + deleted. By default, this is not bound to a key. + .TP .B quoted\-insert (C\-q, C\-v) Add the next character that you type to the line verbatim. This is *************** *** 799,802 **** --- 815,825 ---- This command is intended to be bound to \fBTAB\fP, but is unbound by default. + .TP + .B delete\-char\-or\-list + Deletes the character under the cursor if not at the beginning or + end of the line (like \fBdelete-char\fP). + If at the end of the line, behaves identically to + \fBpossible-completions\fP. + This command is unbound by default. .PD .SS Keyboard Macros *************** *** 848,852 **** command enough times to return the line to its initial state. .TP ! .B tilde\-expand (M\-~) Perform tilde expansion on the current word. .TP --- 871,875 ---- command enough times to return the line to its initial state. .TP ! .B tilde\-expand (M\-&) Perform tilde expansion on the current word. .TP diff -aNrc2 bash-2.02.1/error.c bash-2.03/error.c *** bash-2.02.1/error.c Wed Jul 9 12:45:27 1997 --- bash-2.03/error.c Tue Jan 12 12:55:52 1999 *************** *** 497,498 **** --- 497,527 ---- #endif /* USE_VARARGS */ + + static char *cmd_error_table[] = { + "unknown command error", /* CMDERR_DEFAULT */ + "bad command type", /* CMDERR_BADTYPE */ + "bad connector", /* CMDERR_BADCONN */ + "bad jump", /* CMDERR_BADJUMP */ + 0 + }; + + void + command_error (func, code, e, flags) + const char *func; + int code, e, flags; /* flags currently unused */ + { + if (code > CMDERR_LAST) + code = CMDERR_DEFAULT; + + programming_error ("%s: %s: %d", func, cmd_error_table[code], e); + } + + char * + command_errstr (code) + int code; + { + if (code > CMDERR_LAST) + code = CMDERR_DEFAULT; + + return (cmd_error_table[code]); + } diff -aNrc2 bash-2.02.1/error.h bash-2.03/error.h *** bash-2.02.1/error.h Wed Jul 9 12:45:43 1997 --- bash-2.03/error.h Tue Jan 12 12:46:48 1999 *************** *** 51,53 **** --- 51,58 ---- extern void internal_warning __P((const char *, ...)); + /* Report an error having to do with command parsing or execution. */ + extern void command_error __P((const char *, int, int, int)); + + extern char *command_errstr __P((int)); + #endif /* !_ERROR_H_ */ diff -aNrc2 bash-2.02.1/eval.c bash-2.03/eval.c *** bash-2.02.1/eval.c Tue Mar 17 13:21:46 1998 --- bash-2.03/eval.c Tue Jan 12 12:42:27 1999 *************** *** 42,45 **** --- 42,49 ---- #include "execute_cmd.h" + #if defined (HISTORY) + # include "bashhist.h" + #endif + extern int yyparse (); *************** *** 106,110 **** default: ! programming_error ("reader_loop: bad jump: code %d", code); } } --- 110,114 ---- default: ! command_error ("reader_loop", CMDERR_BADJUMP, code, 0); } } *************** *** 162,166 **** int i; { ! printf ("%ctimed out waiting for input: auto-logout\n", '\07'); jump_to_top_level (EXITPROG); SIGRETURN (0); --- 166,170 ---- int i; { ! printf ("\007timed out waiting for input: auto-logout\n"); jump_to_top_level (EXITPROG); SIGRETURN (0); *************** *** 270,273 **** --- 274,288 ---- WORD_LIST *wl; COMMAND *saved_global; + #if defined (HISTORY) + int old_remember_on_history, old_history_expansion_inhibited; + #endif + + #if defined (HISTORY) + old_remember_on_history = remember_on_history; + # if defined (BANG_HISTORY) + old_history_expansion_inhibited = history_expansion_inhibited; + # endif + bash_history_disable (); + #endif push_stream (1); *************** *** 293,296 **** --- 308,318 ---- pop_stream (); + + #if defined (HISTORY) + remember_on_history = old_remember_on_history; + # if defined (BANG_HISTORY) + history_expansion_inhibited = old_history_expansion_inhibited; + # endif /* BANG_HISTORY */ + #endif /* HISTORY */ return (wl); diff -aNrc2 bash-2.02.1/examples/functions/autoload.v3 bash-2.03/examples/functions/autoload.v3 *** bash-2.02.1/examples/functions/autoload.v3 Wed Dec 31 19:00:00 1969 --- bash-2.03/examples/functions/autoload.v3 Tue Aug 25 11:55:28 1998 *************** *** 0 **** --- 1,125 ---- + #From: Mark Kennedy + #Message-ID: <35E2B899.63A02DF5@ny.ubs.com> + #Date: Tue, 25 Aug 1998 09:14:01 -0400 + #To: chet@nike.ins.cwru.edu + #Subject: a newer version of the ksh-style 'autoload' + + #enclosed you'll find 'autoload.v3', a version of the autoloader + #that emulates the ksh semantics of delaying the resolution (and loading) of the function + #until its first use. i took the liberty of simplifying the code a bit although it still uses the + #same functional breakdown. i recently went through the exercise of converting + #my ksh-based environment to bash (a very, very pleasant experience) + #and this popped out. + + # the psuedo-ksh autoloader. + + # The first cut of this was by Bill Trost, trost@reed.bitnet. + # The second cut came from Chet Ramey, chet@ins.CWRU.Edu + # The third cut came from Mark Kennedy, mtk@ny.ubs.com. 1998/08/25 + + unset _AUTOLOADS + + _aload() + { + local func + for func; do + eval $func '() + { + local f=$(_autoload_resolve '$func') + if [[ $f ]]; then + . $f + '$func' "$@" + return $? + else + return 1 + fi + }' + _autoload_addlist $func + done + } + + _autoload_addlist() + { + local func + + for func in ${_AUTOLOADS[@]}; do + [[ $func = "$1" ]] && return + done + + _AUTOLOADS[${#_AUTOLOADS[@]}]=$1 + } + + _autoload_dump() + { + local func + + for func in ${_AUTOLOADS[@]}; do + [[ $1 ]] && echo -n "autoload " + echo $func + done + } + + _autoload_remove_one() + { + local func + local -a NEW_AUTOLOADS + + for func in ${_AUTOLOADS[@]}; do + [[ $func != "$1" ]] && NEW_AUTOLOADS[${#NEW_AUTOLOADS[@]}]=$func + done + + _AUTOLOADS=( ${NEW_AUTOLOADS[@]} ) + } + + _autoload_remove() + { + local victim func + + for victim; do + for func in ${_AUTOLOADS[@]}; do + [[ $victim = "$func" ]] && unset -f $func && continue 2 + done + echo "autoload: $func: not an autoloaded function" >&2 + done + + for func; do + _autoload_remove_one $func + done + } + + _autoload_resolve() + { + if [[ ! "$FPATH" ]]; then + echo "autoload: FPATH not set or null" >&2 + return + fi + + local p + + for p in $( (IFS=':'; set -- ${FPATH}; echo "$@") ); do + p=${p:-.} + if [ -f $p/$1 ]; then echo $p/$1; return; fi + done + + echo "autoload: $1: function source file not found" >&2 + } + + autoload() + { + if (( $# == 0 )) ; then _autoload_dump; return; fi + + local opt OPTIND + + while getopts pu opt + do + case $opt in + p) _autoload_dump printable; return;; + u) shift $((OPTIND-1)); _autoload_remove "$@"; return;; + *) echo "autoload: usage: autoload [-pu] [function ...]" >&2; return;; + esac + done + + shift $(($OPTIND-1)) + + _aload "$@" + } diff -aNrc2 bash-2.02.1/examples/functions/inetaddr bash-2.03/examples/functions/inetaddr *** bash-2.02.1/examples/functions/inetaddr Mon Nov 3 15:04:16 1997 --- bash-2.03/examples/functions/inetaddr Fri Oct 30 14:02:13 1998 *************** *** 24,27 **** --- 24,38 ---- { local x1 x2 x3 x4 + local rev + + OPTIND=1 + while getopts "r" o + do + case "$o" in + r) rev=true;; + *) echo "hex2inet: usage: hex2inet [0x]XXXXXXXX" >&2 ; exit 2;; + esac + done + shift $(( $OPTIND - 1 )) case "$1" in *************** *** 41,44 **** x4=$(( 0x${h:6:2} )) ! printf "%d.%d.%d.%d\n" $x1 $x2 $x3 $x4 } --- 52,60 ---- x4=$(( 0x${h:6:2} )) ! if [ -z "$rev" ] ; then ! printf "%d.%d.%d.%d\n" $x1 $x2 $x3 $x4 ! else ! printf "%d.%d.%d.%d\n" $x4 $x3 $x2 $x1 ! fi ! return 0 } diff -aNrc2 bash-2.02.1/examples/functions/lowercase bash-2.03/examples/functions/lowercase *** bash-2.02.1/examples/functions/lowercase Tue May 28 17:29:57 1996 --- bash-2.03/examples/functions/lowercase Thu May 21 14:02:28 1998 *************** *** 9,26 **** lowercase() { ! for file; do ! filename=${file##*/} ! case "$filename" in ! */*) dirname=${file%/*} ;; ! *) dirname=.;; ! esac ! nf=$(echo $filename | tr A-Z a-z) ! newname="${dirname}/${nf}" ! if [ "$nf" != "$filename" ]; then ! mv "$file" "$newname" ! echo "$0: $file -> $newname" ! else ! echo "$0: $file not changed." ! fi ! done } --- 9,26 ---- lowercase() { ! for file; do ! filename=${file##*/} ! case "$filename" in ! */*) dirname=${file%/*} ;; ! *) dirname=.;; ! esac ! nf=$(echo $filename | tr A-Z a-z) ! newname="${dirname}/${nf}" ! if [ "$nf" != "$filename" ]; then ! mv "$file" "$newname" ! echo "lowercase: $file -> $newname" ! else ! echo "lowercase: $file not changed." ! fi ! done } diff -aNrc2 bash-2.02.1/examples/functions/repeat3 bash-2.03/examples/functions/repeat3 *** bash-2.02.1/examples/functions/repeat3 Wed Dec 31 19:00:00 1969 --- bash-2.03/examples/functions/repeat3 Thu Aug 27 10:21:37 1998 *************** *** 0 **** --- 1,12 ---- + # From psamuels@jake.niar.twsu.edu (Peter Samuelson) + # posted to usenet, Message-ID: <6rtp8j$2a0$1@jake.niar.twsu.edu> + + repeat () + { + local i max; # note that you can use \$i in the command string + max=$1; shift; + + i=1; while ((i <= max)); do + eval "$@"; ((i = i + 1)); + done; + } diff -aNrc2 bash-2.02.1/examples/functions/seq2 bash-2.03/examples/functions/seq2 *** bash-2.02.1/examples/functions/seq2 Wed Dec 31 19:00:00 1969 --- bash-2.03/examples/functions/seq2 Thu Dec 10 13:03:04 1998 *************** *** 0 **** --- 1,37 ---- + # Generate a sequence from m to n, m defaults to 1. + + seq () + { + declare -i lo hi i # makes local + local _SEQ INIT COMPARE STEP + + case "$1" in + -r) INIT='i=$hi _SEQ=""' COMPARE='let "i >= $lo"' STEP='let i-=1' ; shift ;; + *) INIT='i=$lo _SEQ=""' COMPARE='let "i <= $hi"' STEP='let i+=1' ;; + esac + + case $# in + 1) lo=1 hi="$1" ;; + 2) lo=$1 hi=$2 ;; + *) echo seq: usage: seq [-r] [low] high 1>&2 ; return 2 ;; + esac + + # equivalent to the as-yet-unimplemented + # for (( "$INIT" ; "$COMPARE" ; "$STEP" )); do _SEQ="${_SEQ}$i "; done + eval "$INIT" + while eval "$COMPARE"; do + _SEQ="${_SEQ}$i " + eval "$STEP" + done + echo "${_SEQ# }" + return 0 + } + + # like the APL `iota' function (or at least how I remember it :-) + iota() + { + case $# in + 1) seq 1 "$1"; return $?;; + *) echo "iota: usage: iota high" 1>&2; return 2;; + esac + } diff -aNrc2 bash-2.02.1/examples/functions/which bash-2.03/examples/functions/which *** bash-2.02.1/examples/functions/which Wed Dec 31 19:00:00 1969 --- bash-2.03/examples/functions/which Wed Dec 30 12:14:03 1998 *************** *** 0 **** --- 1,44 ---- + # + # which - emulation of `which' as it appears in FreeBSD + # + # usage: which [-as] command [command...] + # + + which() + { + local aflag sflag ES a + + OPTIND=1 + while builtin getopts as opt ; do + case "$opt" in + a) aflag=-a ;; + s) sflag=1 ;; + ?) echo "which: usage: which [-as] command [command ...]" >&2 + exit 2 ;; + esac + done + + (( $OPTIND > 1 )) && shift $(( $OPTIND - 1 )) + + # without command arguments, exit with status 1 + ES=1 + + # exit status is 0 if all commands are found, 1 if any are not found + for command; do + # if $command is a function, make sure we add -a so type + # will look in $PATH after finding the function + a=$aflag + case "$(builtin type -t $command)" in + "function") a=-a;; + esac + + if [ -n "$sflag" ]; then + builtin type -p $a $command >/dev/null 2>&1 + else + builtin type -p $a $command + fi + ES=$? + done + + return $ES + } diff -aNrc2 bash-2.02.1/examples/loadables/Makefile.in bash-2.03/examples/loadables/Makefile.in *** bash-2.02.1/examples/loadables/Makefile.in Thu Feb 19 15:12:52 1998 --- bash-2.03/examples/loadables/Makefile.in Thu Feb 18 12:15:26 1999 *************** *** 2,7 **** # Simple makefile for the sample loadable builtins # - # This includes some boilerplate definitions added by configure, but will - # still need hand-editing # # Include some boilerplate Gnu makefile definitions. --- 2,5 ---- *************** *** 23,73 **** RM = rm -f ! SHELL = /bin/sh ! # SunOS 4 ! #PICFLAG = -pic ! # Some versions of gcc, esp. on NetBSD and FreeBSD ! PICFLAG = -fpic ! # Linux -- could also be -fpic ! #PICFLAG = -fPIC ! # SunOS 5 ! #PICFLAG = -K pic ! # SVR4, SVR4.2, Irix ! #PICFLAG = -K PIC ! # BSD/OS 2.1, BSD/OS 3.x ! #PICFLAG = ! # AIX 4.2 ! #PICFLAG = -K ! ! # SunOS 4, BSD/OS 2.1, BSD/OS 3.x, SVR4.2, SVR4, Linux, AIX 4.2, etc. ! LD = ld ! # SunOS 5, Linux ! #LD = ${CC} ! ! # SunOS 4 ! #LDOPT = -assert pure-text ! # OSF/1, Digital UNIX ! #LDOPT = -shared -soname $@ -expect_unresolved '*' ! # SunOS 5 using sun cc ! #LDOPT = -dy -z text -G -i -h $@ ! # SunOS 5 using gcc with Sun ld ! #LDOPT = -shared -Wl,-dy -Wl,-G -Wl,-i ! # SVR4, SVR4.2 ! #LDOPT = -dy -z text -G -h $@ ! # NetBSD, FreeBSD -- might also need -r ! LDOPT = -x -Bshareable ! # Linux ! #LDOPT = -shared ! # BSD/OS 2.1, BSD/OS 3.x ! #LDOPT = -r ! # AIX 4.2 ! #LDOPT = -bdynamic -bnoentry -bexpall -G ! ! # other libraries to link the shared object against ! # BSD/OS 2.1 ! #LDLIBS = -lc_s.2.1.0 ! # BSD/OS 3.0, BSD/OS 3.1 ! #LDLIBS = -lc_s.3.0.0 INC = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(topdir)/builtins \ --- 21,45 ---- RM = rm -f ! SHELL = @MAKE_SHELL@ ! host_os = @host_os@ ! host_cpu = @host_cpu@ ! host_vendor = @host_vendor@ + CFLAGS = @CFLAGS@ + + # + # These values are generated for configure by ${topdir}/support/shobj-conf. + # If your system is not supported by that script, but includes facilities for + # dynamic loading of shared objects, please update the script and send the + # changes to bash-maintainers@gnu.org. + # + SHOBJ_CC = @SHOBJ_CC@ + SHOBJ_CFLAGS = @SHOBJ_CFLAGS@ + SHOBJ_LD = @SHOBJ_LD@ + SHOBJ_LDFLAGS = @SHOBJ_LDFLAGS@ + SHOBJ_XLDFLAGS = @SHOBJ_XLDFLAGS@ + SHOBJ_LIBS = @SHOBJ_LIBS@ + SHOBJ_STATUS = @SHOBJ_STATUS@ INC = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(topdir)/builtins \ *************** *** 75,143 **** .c.o: ! $(CC) $(PICFLAG) $(CFLAGS) $(INC) -c -o $@ $< ALLPROG = print truefalse sleep pushd finfo logname basename dirname \ ! tty pathchk tee head rmdir sprintf OTHERPROG = necho getconf hello cat ! all: $(ALLPROG) ! others: $(OTHERPROG) ! everything: all others sprintf: sprintf.o ! $(LD) $(LDOPT) -o $@ sprintf.o $(LDLIBS) print: print.o ! $(LD) $(LDOPT) -o $@ print.o $(LDLIBS) necho: necho.o ! $(LD) $(LDOPT) -o $@ necho.o $(LDLIBS) getconf: getconf.o ! $(LD) $(LDOPT) -o $@ getconf.o $(LDLIBS) hello: hello.o ! $(LD) $(LDOPT) -o $@ hello.o $(LDLIBS) truefalse: truefalse.o ! $(LD) $(LDOPT) -o $@ truefalse.o $(LDLIBS) sleep: sleep.o ! $(LD) $(LDOPT) -o $@ sleep.o $(LDLIBS) ! ! pushd: pushd.o ! $(LD) $(LDOPT) -o $@ pushd.o $(LDLIBS) finfo: finfo.o ! $(LD) $(LDOPT) -o $@ finfo.o $(LDLIBS) cat: cat.o ! $(LD) $(LDOPT) -o $@ cat.o $(LDLIBS) logname: logname.o ! $(LD) $(LDOPT) -o $@ logname.o $(LDLIBS) basename: basename.o ! $(LD) $(LDOPT) -o $@ basename.o $(LDLIBS) dirname: dirname.o ! $(LD) $(LDOPT) -o $@ dirname.o $(LDLIBS) tty: tty.o ! $(LD) $(LDOPT) -o $@ tty.o $(LDLIBS) pathchk: pathchk.o ! $(LD) $(LDOPT) -o $@ pathchk.o $(LDLIBS) tee: tee.o ! $(LD) $(LDOPT) -o $@ tee.o $(LDLIBS) rmdir: rmdir.o ! $(LD) $(LDOPT) -o $@ rmdir.o $(LDLIBS) head: head.o ! $(LD) $(LDOPT) -o $@ head.o $(LDLIBS) clean: --- 47,166 ---- .c.o: ! $(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CFLAGS) $(INC) -c -o $@ $< ALLPROG = print truefalse sleep pushd finfo logname basename dirname \ ! tty pathchk tee head mkdir rmdir sprintf printenv id whoami \ ! uname sync push ln unlink OTHERPROG = necho getconf hello cat ! all: $(SHOBJ_STATUS) ! supported: $(ALLPROG) ! others: $(OTHERPROG) ! ! unsupported: ! @echo "Your system (${host_os}) is not supported by the" ! @echo "${topdir}/support/shobj-conf script." ! @echo "If your operating system provides facilities for dynamic" ! @echo "loading of shared objects using the dlopen(3) interface," ! @echo "please update the script and re-run configure. ! @echo "Please send the changes you made to bash-maintainers@gnu.org" ! @echo "for inclusion in future bash releases." ! ! everything: supported others sprintf: sprintf.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ sprintf.o $(SHOBJ_LIBS) print: print.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ print.o $(SHOBJ_LIBS) necho: necho.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ necho.o $(SHOBJ_LIBS) getconf: getconf.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ getconf.o $(SHOBJ_LIBS) hello: hello.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ hello.o $(SHOBJ_LIBS) truefalse: truefalse.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ truefalse.o $(SHOBJ_LIBS) sleep: sleep.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ sleep.o $(SHOBJ_LIBS) finfo: finfo.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ finfo.o $(SHOBJ_LIBS) cat: cat.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ cat.o $(SHOBJ_LIBS) logname: logname.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ logname.o $(SHOBJ_LIBS) basename: basename.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ basename.o $(SHOBJ_LIBS) dirname: dirname.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ dirname.o $(SHOBJ_LIBS) tty: tty.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ tty.o $(SHOBJ_LIBS) pathchk: pathchk.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ pathchk.o $(SHOBJ_LIBS) tee: tee.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ tee.o $(SHOBJ_LIBS) ! ! mkdir: mkdir.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ mkdir.o $(SHOBJ_LIBS) rmdir: rmdir.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ rmdir.o $(SHOBJ_LIBS) head: head.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ head.o $(SHOBJ_LIBS) ! ! printenv: printenv.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ printenv.o $(SHOBJ_LIBS) ! ! id: id.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ id.o $(SHOBJ_LIBS) ! ! whoami: whoami.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ whoami.o $(SHOBJ_LIBS) ! ! uname: uname.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ uname.o $(SHOBJ_LIBS) ! ! sync: sync.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ sync.o $(SHOBJ_LIBS) ! ! push: push.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ push.o $(SHOBJ_LIBS) ! ! ln: ln.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ ln.o $(SHOBJ_LIBS) ! ! unlink: unlink.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ unlink.o $(SHOBJ_LIBS) ! ! ! # pushd is a special case. We use the same source that the builtin version ! # uses, with special compilation options. ! # ! pushd.c: ${topdir}/builtins/pushd.def ! $(RM) $@ ! ${BUILD_DIR}/builtins/mkbuiltins -D ${topdir}/builtins ${topdir}/builtins/pushd.def ! ! pushd.o: pushd.c ! $(RM) $@ ! $(SHOBJ_CC) -DPUSHD_AND_POPD -DLOADABLE_BUILTIN $(SHOBJ_CFLAGS) $(CFLAGS) $(INC) -c -o $@ $< ! ! pushd: pushd.o ! $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ pushd.o $(SHOBJ_LIBS) clean: *************** *** 147,156 **** distclean maintainer-clean: clean ! $(RM) Makefile print.o: print.c truefalse.o: truefalse.c sleep.o: sleep.c - pushd.o: pushd.c finfo.o: finfo.c logname.o: logname.c --- 170,178 ---- distclean maintainer-clean: clean ! $(RM) Makefile pushd.c print.o: print.c truefalse.o: truefalse.c sleep.o: sleep.c finfo.o: finfo.c logname.o: logname.c *************** *** 167,169 **** hello.o: hello.c cat.o: cat.c ! --- 189,197 ---- hello.o: hello.c cat.o: cat.c ! printenv.o: printenv.c ! id.o: id.c ! whoami.o: whoami.c ! uname.o: uname.c ! sync.o: sync.c ! push.o: push.c ! mkdir.o: mkdir.c diff -aNrc2 bash-2.02.1/examples/loadables/README bash-2.03/examples/loadables/README *** bash-2.02.1/examples/loadables/README Fri May 24 15:13:56 1996 --- bash-2.03/examples/loadables/README Thu May 7 14:31:34 1998 *************** *** 11,21 **** are included here, as is the ksh `print' builtin. ! Compile with cc and whatever pic options you need (look in the ! Makefile for a few common settings) ! load with ld and whatever shared object options you need (again, ! look in the Makefile) ! then enable -f filename builtin-name enable uses a simple reference-counting scheme to avoid unloading a --- 11,26 ---- are included here, as is the ksh `print' builtin. ! The configure script in the top-level source directory uses the ! support/shobj-conf script to set the right values in the Makefile, ! so you should not need to change the Makefile. If your system ! is not supported by support/shobj-conf, and it has the necessary ! facilities for building shared objects and support for the ! dlopen/dlsyn/dlclose/dlerror family of functions, please make ! the necessary changes to support/shobj-conf and send the changes ! to bash-maintainers@gnu.org. ! Loadable builtins are loaded into a running shell with ! enable -f filename builtin-name enable uses a simple reference-counting scheme to avoid unloading a *************** *** 25,27 **** Many of the details needed by builtin writers are found in hello.c, the canonical example. There is no real `builtin writers' programming ! guide'. --- 30,33 ---- Many of the details needed by builtin writers are found in hello.c, the canonical example. There is no real `builtin writers' programming ! guide'. The file template.c provides a template to use for creating ! new loadable builtins. diff -aNrc2 bash-2.02.1/examples/loadables/dirname.c bash-2.03/examples/loadables/dirname.c *** bash-2.02.1/examples/loadables/dirname.c Thu May 9 12:19:18 1996 --- bash-2.03/examples/loadables/dirname.c Sat May 2 21:58:49 1998 *************** *** 59,63 **** break; ! if (slen >= 0) { fputs (".\n", stdout); --- 59,63 ---- break; ! if (slen < 0) { fputs (".\n", stdout); diff -aNrc2 bash-2.02.1/examples/loadables/finfo.c bash-2.03/examples/loadables/finfo.c *** bash-2.02.1/examples/loadables/finfo.c Wed Oct 23 11:00:13 1996 --- bash-2.03/examples/loadables/finfo.c Fri Nov 13 11:42:40 1998 *************** *** 197,200 **** --- 197,207 ---- obits[i] = '\0'; + if (m & S_ISUID) + ubits[2] = (m & S_IXUSR) ? 's' : 'S'; + if (m & S_ISGID) + gbits[2] = (m & S_IXGRP) ? 's' : 'S'; + if (m & S_ISVTX) + obits[2] = (m & S_IXOTH) ? 't' : 'T'; + printf ("u=%s,g=%s,o=%s", ubits, gbits, obits); } *************** *** 218,221 **** --- 225,232 ---- if (S_ISSOCK(mode)) printf("S_IFSOCK "); + #ifdef S_ISWHT + if (S_ISWHT(mode)) + printf("S_ISWHT "); + #endif perms(getperm(mode)); printf("\n"); diff -aNrc2 bash-2.02.1/examples/loadables/hello.c bash-2.03/examples/loadables/hello.c *** bash-2.02.1/examples/loadables/hello.c Fri May 24 15:09:23 1996 --- bash-2.03/examples/loadables/hello.c Fri Nov 20 14:05:07 1998 *************** *** 4,8 **** /* See Makefile for compilation details. */ ! #include "config.h" #if defined (HAVE_UNISTD_H) --- 4,8 ---- /* See Makefile for compilation details. */ ! #include #if defined (HAVE_UNISTD_H) *************** *** 11,20 **** #include #include "builtins.h" #include "shell.h" /* A builtin `xxx' is normally implemented with an `xxx_builtin' function. If you're converting a command that uses the normal Unix argc/argv ! calling convention, use argv = word_list_to_argv (list, &argc) and call the original `main' something like `xxx_main'. Look at cat.c for an example. --- 11,22 ---- #include + #include "builtins.h" #include "shell.h" + #include "bashgetopt.h" /* A builtin `xxx' is normally implemented with an `xxx_builtin' function. If you're converting a command that uses the normal Unix argc/argv ! calling convention, use argv = make_builtin_argv (list, &argc) and call the original `main' something like `xxx_main'. Look at cat.c for an example. *************** *** 42,46 **** char *hello_doc[] = { "this is the long doc for the sample hello builtin", - "which is a bare-bones echo", (char *)NULL }; --- 44,47 ---- *************** *** 54,58 **** BUILTIN_ENABLED, /* initial flags for builtin */ hello_doc, /* array of long documentation strings. */ ! "hello [args]", /* usage synopsis; becomes short_doc */ 0 /* reserved for internal use */ }; --- 55,59 ---- BUILTIN_ENABLED, /* initial flags for builtin */ hello_doc, /* array of long documentation strings. */ ! "hello", /* usage synopsis; becomes short_doc */ 0 /* reserved for internal use */ }; diff -aNrc2 bash-2.02.1/examples/loadables/id.c bash-2.03/examples/loadables/id.c *** bash-2.02.1/examples/loadables/id.c Wed Dec 31 19:00:00 1969 --- bash-2.03/examples/loadables/id.c Wed May 6 10:40:31 1998 *************** *** 0 **** --- 1,308 ---- + /* + * id - POSIX.2 user identity + * + * (INCOMPLETE -- supplementary groups for other users not yet done) + * + * usage: id [-Ggu] [-nr] [user] + * + * The default output format looks something like: + * uid=xxx(chet) gid=xx groups=aa(aname), bb(bname), cc(cname) + */ + + #include + #include + #include "bashtypes.h" + #include + #include + #include "bashansi.h" + + #ifdef HAVE_LIMITS_H + # include + #else + # include + #endif + + #if !defined (HAVE_GETPW_DECLS) + extern struct passwd *getpwuid (); + #endif + extern struct group *getgrgid (); + + #include "shell.h" + #include "builtins.h" + #include "stdc.h" + #include "common.h" + #include "bashgetopt.h" + + #define ID_ALLGROUPS 0x001 /* -G */ + #define ID_GIDONLY 0x002 /* -g */ + #define ID_USENAME 0x004 /* -n */ + #define ID_USEREAL 0x008 /* -r */ + #define ID_USERONLY 0x010 /* -u */ + + #define ID_FLAGSET(s) ((id_flags & (s)) != 0) + + static int id_flags; + + static uid_t ruid, euid; + static gid_t rgid, egid; + + static char *id_user; + + static int inituser (); + + static int id_pruser (); + static int id_prgrp (); + static int id_prgroups (); + static int id_prall (); + + int + id_builtin (list) + WORD_LIST *list; + { + int opt; + char *user; + + id_flags = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "Ggnru")) != -1) + { + switch (opt) + { + case 'G': id_flags |= ID_ALLGROUPS; break; + case 'g': id_flags |= ID_GIDONLY; break; + case 'n': id_flags |= ID_USENAME; break; + case 'r': id_flags |= ID_USEREAL; break; + case 'u': id_flags |= ID_USERONLY; break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + user = list ? list->word->word : (char *)NULL; + + /* Check for some invalid option combinations */ + opt = ID_FLAGSET (ID_ALLGROUPS) + ID_FLAGSET (ID_GIDONLY) + ID_FLAGSET (ID_USERONLY); + if (opt > 1 || (opt == 0 && ((id_flags & (ID_USEREAL|ID_USENAME)) != 0))) + { + builtin_usage (); + return (EX_USAGE); + } + + if (list && list->next) + { + builtin_usage (); + return (EX_USAGE); + } + + if (inituser (user) < 0) + return (EXECUTION_FAILURE); + + opt = 0; + if (id_flags & ID_USERONLY) + opt += id_pruser ((id_flags & ID_USEREAL) ? ruid : euid); + else if (id_flags & ID_GIDONLY) + opt += id_prgrp ((id_flags & ID_USEREAL) ? rgid : egid); + else if (id_flags & ID_ALLGROUPS) + opt += id_prgroups (user); + else + opt += id_prall (user); + putchar ('\n'); + fflush (stdout); + + return (opt == 0 ? EXECUTION_SUCCESS : EXECUTION_FAILURE); + } + + static int + inituser (uname) + char *uname; + { + struct passwd *pwd; + + if (uname) + { + pwd = getpwnam (uname); + if (pwd == 0) + { + builtin_error ("%s: no such user", uname); + return -1; + } + ruid = euid = pwd->pw_uid; + rgid = egid = pwd->pw_gid; + } + else + { + ruid = current_user.uid; + euid = current_user.euid; + rgid = current_user.gid; + egid = current_user.egid; + } + return 0; + } + + /* Print the name or value of user ID UID. */ + static int + id_pruser (uid) + int uid; + { + struct passwd *pwd = NULL; + int r; + + r = 0; + if (id_flags & ID_USENAME) + { + pwd = getpwuid (uid); + if (pwd == NULL) + r = 1; + } + if (pwd) + printf ("%s", pwd->pw_name); + else + printf ("%u", (unsigned) uid); + + return r; + } + + /* Print the name or value of group ID GID. */ + + static int + id_prgrp (gid) + int gid; + { + struct group *grp = NULL; + int r; + + r = 0; + if (id_flags & ID_USENAME) + { + grp = getgrgid (gid); + if (grp == NULL) + r = 1; + } + + if (grp) + printf ("%s", grp->gr_name); + else + printf ("%u", (unsigned) gid); + + return r; + } + + static int + id_prgroups (uname) + char *uname; + { + int *glist, ng, i, r; + + r = 0; + id_prgrp (rgid); + if (egid != rgid) + { + putchar (' '); + id_prgrp (egid); + } + + if (uname) + { + builtin_error ("supplementary groups for other users not yet implemented"); + glist = (int *)NULL; + ng = 0; + r = 1; + } + else + glist = get_group_array (&ng); + + for (i = 0; i < ng; i++) + if (glist[i] != rgid && glist[i] != egid) + { + putchar (' '); + id_prgrp (glist[i]); + } + + return r; + } + + static int + id_prall (uname) + char *uname; + { + int r, i, ng, *glist; + struct passwd *pwd; + struct group *grp; + + r = 0; + printf ("uid=%u", (unsigned) ruid); + pwd = getpwuid (ruid); + if (pwd == NULL) + r = 1; + else + printf ("(%s)", pwd->pw_name); + + printf (" gid=%u", (unsigned) rgid); + grp = getgrgid (rgid); + if (grp == NULL) + r = 1; + else + printf ("(%s)", grp->gr_name); + + if (euid != ruid) + { + printf (" euid=%u", (unsigned) euid); + pwd = getpwuid (euid); + if (pwd == NULL) + r = 1; + else + printf ("(%s)", pwd->pw_name); + } + + if (egid != rgid) + { + printf (" egid=%u", (unsigned) egid); + grp = getgrgid (egid); + if (grp == NULL) + r = 1; + else + printf ("(%s)", grp->gr_name); + } + + if (uname) + { + builtin_error ("supplementary groups for other users not yet implemented"); + glist = (int *)NULL; + ng = 0; + r = 1; + } + else + glist = get_group_array (&ng); + + if (ng > 0) + printf (" groups="); + for (i = 0; i < ng; i++) + { + if (i > 0) + printf (", "); + printf ("%u", (unsigned) glist[i]); + grp = getgrgid (glist[i]); + if (grp == NULL) + r = 1; + else + printf ("(%s)", grp->gr_name); + } + + return r; + } + + char *id_doc[] = { + "return information about user identity", + (char *)NULL + }; + + struct builtin id_struct = { + "id", + id_builtin, + BUILTIN_ENABLED, + id_doc, + "id [user]\n\tid -G [-n] [user]\n\tid -g [-nr] [user]\n\tid -u [-nr] [user]", + 0 + }; diff -aNrc2 bash-2.02.1/examples/loadables/ln.c bash-2.03/examples/loadables/ln.c *** bash-2.02.1/examples/loadables/ln.c Wed Dec 31 19:00:00 1969 --- bash-2.03/examples/loadables/ln.c Fri Nov 13 13:10:04 1998 *************** *** 0 **** --- 1,203 ---- + /* ln - make links */ + + /* See Makefile for compilation details. */ + + #include "config.h" + + #include "bashtypes.h" + + #if defined (HAVE_UNISTD_H) + # include + #endif + + #include "posixstat.h" + + #include + #include + + #include "builtins.h" + #include "shell.h" + #include "bashgetopt.h" + + #if !defined (errno) + extern int errno; + #endif + + #define LN_SYMLINK 0x01 + #define LN_UNLINK 0x02 + + static Function *linkfn; + static int dolink (); + + ln_builtin (list) + WORD_LIST *list; + { + int rval, opt, flags; + WORD_LIST *l; + char *sdir; + struct stat sb; + + flags = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "fs")) != -1) + { + switch (opt) + { + case 'f': + flags |= LN_UNLINK; + break; + case 's': + flags |= LN_SYMLINK; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + linkfn = (flags & LN_SYMLINK) ? symlink : link; + + if (list->next == 0) /* ln target, equivalent to ln target . */ + return (dolink (list->word->word, ".", flags)); + + if (list->next->next == 0) /* ln target source */ + return (dolink (list->word->word, list->next->word->word, flags)); + + /* ln target1 target2 ... directory */ + + /* find last argument: target directory, and make sure it's an existing + directory. */ + for (l = list; l->next; l = l->next) + ; + sdir = l->word->word; + + if (stat(sdir, &sb) < 0) + { + builtin_error ("%s", sdir); + return (EXECUTION_FAILURE); + } + + if (S_ISDIR (sb.st_mode) == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + for (rval = EXECUTION_SUCCESS; list != l; list = list->next) + rval += dolink (list->word->word, sdir, flags); + + return rval; + } + + static char * + mkdirpath (dir, file) + char *dir, *file; + { + int dlen, flen; + char *ret; + + dlen = strlen (dir); + flen = strlen (file); + + ret = xmalloc (2 + dlen + flen); + + strcpy (ret, dir); + if (ret[dlen - 1] != '/') + ret[dlen++] = '/'; + strcpy (ret + dlen, file); + return ret; + } + + #if defined (HAVE_LSTAT) + # define LSTAT lstat + #else + # define LSTAT stat + #endif + + static int + dolink (src, dst, flags) + char *src, *dst; + int flags; + { + struct stat ssb, dsb; + int exists; + char *dst_path, *p; + + /* If we're not doing symlinks, the source must exist and not be a + directory. */ + if ((flags & LN_SYMLINK) == 0) + { + if (stat (src, &ssb) != 0) + { + builtin_error ("%s: %s", src, strerror (errno)); + return (EXECUTION_FAILURE); + } + if (S_ISDIR (ssb.st_mode)) + { + errno = EISDIR; + builtin_error ("%s: %s", src, strerror (errno)); + return (EXECUTION_FAILURE); + } + } + + /* If the destination is a directory, create the final filename by appending + the basename of the source to the destination. */ + dst_path = 0; + if ((stat (dst, &dsb) == 0) && S_ISDIR (dsb.st_mode)) + { + if ((p = strrchr (src, '/')) == 0) + p = src; + else + p++; + + dst_path = mkdirpath (dst, p); + dst = dst_path; + } + + exists = LSTAT (dst, &dsb) == 0; + + /* If -f was specified, and the destination exists, unlink it. */ + if ((flags & LN_UNLINK) && exists && unlink (dst) != 0) + { + builtin_error ("%s: cannot unlink: %s", dst, strerror (errno)); + FREE (dst_path); + return (EXECUTION_FAILURE); + } + + /* Perform the link. */ + if ((*linkfn) (src, dst) != 0) + { + builtin_error ("cannot link %s to %s: %s", dst, src, strerror (errno)); + FREE (dst_path); + return (EXECUTION_FAILURE); + } + + FREE (dst_path); + return (EXECUTION_SUCCESS); + } + + char *ln_doc[] = { + "Create a new directory entry with the same modes as the original", + "file. The -f option means to unlink any existing file, permitting", + "the link to occur. The -s option means to create a symbolic link.", + "By default, ln makes hard links.", + (char *)NULL + }; + + /* The standard structure describing a builtin command. bash keeps an array + of these structures. */ + struct builtin ln_struct = { + "ln", /* builtin name */ + ln_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + ln_doc, /* array of long documentation strings. */ + "ln [-fs] file1 [file2] OR ln [-fs] file ... directory", /* usage synopsis; becomes short_doc */ + 0 /* reserved for internal use */ + }; diff -aNrc2 bash-2.02.1/examples/loadables/mkdir.c bash-2.03/examples/loadables/mkdir.c *** bash-2.02.1/examples/loadables/mkdir.c Wed Dec 31 19:00:00 1969 --- bash-2.03/examples/loadables/mkdir.c Thu May 7 14:26:48 1998 *************** *** 0 **** --- 1,216 ---- + /* mkdir - make directories */ + + /* See Makefile for compilation details. */ + + #include + + #include "bashtypes.h" + #include "posixstat.h" + #include + #include + #include "bashansi.h" + #if defined (HAVE_UNISTD_H) + # include + #endif + + #include "builtins.h" + #include "shell.h" + #include "bashgetopt.h" + + #if !defined (errno) + extern int errno; + #endif + + #define ISOCTAL(c) ((c) >= '0' && (c) <= '7') + + extern int parse_symbolic_mode (); + + static int make_path (); + + static int original_umask; + + int + mkdir_builtin (list) + WORD_LIST *list; + { + int opt, pflag, omode, rval, octal, nmode, parent_mode, um; + char *mode; + WORD_LIST *l; + + reset_internal_getopt (); + pflag = 0; + mode = (char *)NULL; + while ((opt = internal_getopt(list, "m:p")) != -1) + switch (opt) + { + case 'p': + pflag = 1; + break; + case 'm': + mode = list_optarg; + break; + default: + builtin_usage(); + return (EX_USAGE); + } + list = loptend; + + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + if (mode == NULL) + omode = S_IRWXU | S_IRWXG | S_IRWXO; /* a=rwx */ + else if (ISOCTAL (*mode)) /* octal number */ + { + omode = read_octal (mode); + if (omode < 0) + { + builtin_error ("invalid file mode: %s", mode); + return (EXECUTION_FAILURE); + } + octal = 1; + } + else if (mode) + { + /* initial bits are a=rwx; the mode argument modifies them */ + omode = parse_symbolic_mode (mode, S_IRWXU | S_IRWXG | S_IRWXO); + if (omode < 0) + { + builtin_error ("invalid file mode: %s", mode); + return (EXECUTION_FAILURE); + } + octal = 0; + } + + /* Make the new mode */ + original_umask = umask (0); + umask (original_umask); + + nmode = (S_IRWXU | S_IRWXG | S_IRWXO) & ~original_umask; + parent_mode = nmode | (S_IWRITE|S_IEXEC); /* u+wx */ + + /* Adjust new mode based on mode argument */ + nmode &= omode; + + for (rval = EXECUTION_SUCCESS, l = list; l; l = l->next) + { + if (pflag && make_path (l->word->word, nmode, parent_mode)) + { + rval = EXECUTION_FAILURE; + continue; + } + else if (pflag == 0 && mkdir (l->word->word, nmode) < 0) + { + builtin_error ("cannot create directory `%s': %s", l->word->word, strerror (errno)); + rval = EXECUTION_FAILURE; + } + } + return rval; + } + + /* Make all the directories leading up to PATH, then create PATH. Note that + this changes the process's umask; make sure that all paths leading to a + return reset it to ORIGINAL_UMASK */ + static int + make_path (path, nmode, parent_mode) + char *path; + int nmode, parent_mode; + { + int oumask; + struct stat sb; + char *p, *npath; + + if (stat (path, &sb) == 0) + { + if (S_ISDIR (sb.st_mode) == 0) + { + builtin_error ("`%s': file exists but is not a directory", path); + return 1; + } + + if (chmod (path, nmode)) + { + builtin_error ("%s: %s", path, strerror (errno)); + return 1; + } + + return 0; + } + + oumask = umask (0); + npath = savestring (path); /* So we can write to it. */ + + /* Check whether or not we need to do anything with intermediate dirs. */ + + /* Skip leading slashes. */ + p = npath; + while (*p == '/') + p++; + + while (p = strchr (p, '/')) + { + *p = '\0'; + if (stat (npath, &sb) != 0) + { + if (mkdir (npath, parent_mode)) + { + builtin_error ("cannot create directory `%s': %s", npath, strerror (errno)); + umask (original_umask); + free (npath); + return 1; + } + } + else if (S_ISDIR (sb.st_mode) == 0) + { + builtin_error ("`%s': file exists but is not a directory", npath); + umask (original_umask); + free (npath); + return 1; + } + + *p++ = '/'; /* restore slash */ + while (*p == '/') + p++; + } + + /* Create the final directory component. */ + if (stat (npath, &sb) && mkdir (npath, nmode)) + { + builtin_error ("cannot create directory `%s': %s", npath, strerror (errno)); + umask (original_umask); + free (npath); + return 1; + } + + umask (original_umask); + free (npath); + return 0; + } + + char *mkdir_doc[] = { + "Make directories. Create the directories named as arguments, in", + "the order specified, using mode rwxrwxrwx as modified by the current", + "umask (see `help umask'). The -m option causes the file permission", + "bits of the final directory to be MODE. The MODE argument may be", + "an octal number or a symbolic mode like that used by chmod(1). If", + "a symbolic mode is used, the operations are interpreted relative to", + "an initial mode of \"a=rwx\". The -p option causes any required", + "intermediate directories in PATH to be created. The directories", + "are created with permssion bits of rwxrwxrwx as modified by the current", + "umask, plus write and search permissions for the owner. mkdir", + "returns 0 if the directories are created successfully, and non-zero", + "if an error occurs.", + (char *)NULL + }; + + struct builtin mkdir_struct = { + "mkdir", + mkdir_builtin, + BUILTIN_ENABLED, + mkdir_doc, + "mkdir [-p] [-m mode] directory [directory ...]", + 0 + }; diff -aNrc2 bash-2.02.1/examples/loadables/necho.c bash-2.03/examples/loadables/necho.c *** bash-2.02.1/examples/loadables/necho.c Fri May 24 15:07:34 1996 --- bash-2.03/examples/loadables/necho.c Sat May 2 22:30:49 1998 *************** *** 23,27 **** }; ! struct builtin echo_struct = { "echo", necho_builtin, --- 23,27 ---- }; ! struct builtin necho_struct = { "echo", necho_builtin, diff -aNrc2 bash-2.02.1/examples/loadables/pathchk.c bash-2.03/examples/loadables/pathchk.c *** bash-2.02.1/examples/loadables/pathchk.c Wed Oct 23 11:00:29 1996 --- bash-2.03/examples/loadables/pathchk.c Sat May 2 20:48:28 1998 *************** *** 171,176 **** if (portable_chars[(const unsigned char) *p] == 0) { ! error (0, 0, "path `%s' contains nonportable character `%c'", ! path, *p); return 0; } --- 171,175 ---- if (portable_chars[(const unsigned char) *p] == 0) { ! builtin_error ("path `%s' contains nonportable character `%c'", path, *p); return 0; } *************** *** 213,217 **** if (!S_ISDIR (stats.st_mode)) { ! error (0, 0, "`%s' is not a directory", path); return 0; } --- 212,216 ---- if (!S_ISDIR (stats.st_mode)) { ! builtin_error ("`%s' is not a directory", path); return 0; } *************** *** 325,329 **** if (length > name_max) { ! error (0, 0, "name `%s' has length %d; exceeds limit of %d", start, length, name_max); free (parent); --- 324,328 ---- if (length > name_max) { ! builtin_error ("name `%s' has length %d; exceeds limit of %d", start, length, name_max); free (parent); *************** *** 351,355 **** if (strlen (path) > path_max) { ! error (0, 0, "path `%s' has length %d; exceeds limit of %d", path, strlen (path), path_max); return 1; --- 350,354 ---- if (strlen (path) > path_max) { ! builtin_error ("path `%s' has length %d; exceeds limit of %d", path, strlen (path), path_max); return 1; diff -aNrc2 bash-2.02.1/examples/loadables/printenv.c bash-2.03/examples/loadables/printenv.c *** bash-2.02.1/examples/loadables/printenv.c Wed Dec 31 19:00:00 1969 --- bash-2.03/examples/loadables/printenv.c Tue May 5 13:39:28 1998 *************** *** 0 **** --- 1,71 ---- + /* + * printenv -- minimal builtin clone of BSD printenv(1). + * + * usage: printenv [varname] + * + */ + + #include + #include + + #include "builtins.h" + #include "shell.h" + #include "bashgetopt.h" + + extern char **export_env; + + int + printenv_builtin (list) + WORD_LIST *list; + { + register char **envp; + int opt; + SHELL_VAR *var; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "")) != -1) + { + switch (opt) + { + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + /* printenv */ + if (list == 0) + { + maybe_make_export_env (); /* this allows minimal code */ + for (envp = export_env; *envp; envp++) + printf ("%s\n", *envp); + return (EXECUTION_SUCCESS); + } + + /* printenv varname */ + var = find_variable (list->word->word); + if (var == 0 || (exported_p (var) == 0)) + return (EXECUTION_FAILURE); + + if (function_p (var)) + print_var_function (var); + else + print_var_value (var, 0); + + return (EXECUTION_SUCCESS); + } + + char *printenv_doc[] = { + "print values of environment variables", + (char *)NULL + }; + + struct builtin printenv_struct = { + "printenv", + printenv_builtin, + BUILTIN_ENABLED, + printenv_doc, + "printenv [varname]", + 0 + }; diff -aNrc2 bash-2.02.1/examples/loadables/pushd.c bash-2.03/examples/loadables/pushd.c *** bash-2.02.1/examples/loadables/pushd.c Wed Apr 16 14:22:39 1997 --- bash-2.03/examples/loadables/pushd.c Wed Dec 31 19:00:00 1969 *************** *** 1,608 **** - /* pushd.c, created from pushd.def. */ - #include - - #include - #include - - #if defined (HAVE_UNISTD_H) - # include - #endif - - #include "bashansi.h" - - #include - - #include - - #include "shell.h" - #include "builtins.h" - #include "maxpath.h" - #include "common.h" - - #if !defined (errno) - extern int errno; - #endif /* !errno */ - - static char *m_badarg = "%s: bad argument"; - - /* The list of remembered directories. */ - static char **pushd_directory_list = (char **)NULL; - - /* Number of existing slots in this list. */ - static int directory_list_size; - - /* Offset to the end of the list. */ - static int directory_list_offset; - - static void pushd_error (); - static void clear_directory_stack (); - static int cd_to_string (); - static int change_to_temp (); - static int get_dirstack_index (); - static void add_dirstack_element (); - - #define NOCD 0x01 - #define ROTATE 0x02 - #define LONGFORM 0x04 - #define CLEARSTAK 0x08 - - int - pushd_builtin (list) - WORD_LIST *list; - { - char *temp, *current_directory, *top; - int j, flags; - long num; - char direction; - - /* If there is no argument list then switch current and - top of list. */ - if (list == 0) - { - if (directory_list_offset == 0) - { - builtin_error ("no other directory"); - return (EXECUTION_FAILURE); - } - - current_directory = get_working_directory ("pushd"); - if (current_directory == 0) - return (EXECUTION_FAILURE); - - j = directory_list_offset - 1; - temp = pushd_directory_list[j]; - pushd_directory_list[j] = current_directory; - j = change_to_temp (temp); - free (temp); - return j; - } - - for (flags = 0; list; list = list->next) - { - if (ISOPTION (list->word->word, 'n')) - { - flags |= NOCD; - } - else if (ISOPTION (list->word->word, '-')) - { - list = list->next; - break; - } - else if (list->word->word[0] == '-' && list->word->word[1] == '\0') - /* Let `pushd -' work like it used to. */ - break; - else if (((direction = list->word->word[0]) == '+') || direction == '-') - { - if (legal_number (list->word->word + 1, &num) == 0) - { - builtin_error (m_badarg, list->word->word); - builtin_usage (); - return (EXECUTION_FAILURE); - } - - if (direction == '-') - num = directory_list_offset - num; - - if (num > directory_list_offset || num < 0) - { - pushd_error (directory_list_offset, list->word->word); - return (EXECUTION_FAILURE); - } - flags |= ROTATE; - } - else if (*list->word->word == '-') - { - bad_option (list->word->word); - builtin_usage (); - return (EXECUTION_FAILURE); - } - else - break; - } - - if (flags & ROTATE) - { - /* Rotate the stack num times. Remember, the current - directory acts like it is part of the stack. */ - temp = get_working_directory ("pushd"); - - if (num == 0) - { - j = ((flags & NOCD) == 0) ? change_to_temp (temp) : EXECUTION_SUCCESS; - free (temp); - return j; - } - - do - { - top = pushd_directory_list[directory_list_offset - 1]; - - for (j = directory_list_offset - 2; j > -1; j--) - pushd_directory_list[j + 1] = pushd_directory_list[j]; - - pushd_directory_list[j + 1] = temp; - - temp = top; - num--; - } - while (num); - - j = ((flags & NOCD) == 0) ? change_to_temp (temp) : EXECUTION_SUCCESS; - free (temp); - return j; - } - - if (list == 0) - return (EXECUTION_SUCCESS); - - /* Change to the directory in list->word->word. Save the current - directory on the top of the stack. */ - current_directory = get_working_directory ("pushd"); - if (current_directory == 0) - return (EXECUTION_FAILURE); - - j = ((flags & NOCD) == 0) ? cd_builtin (list) : EXECUTION_SUCCESS; - if (j == EXECUTION_SUCCESS) - { - add_dirstack_element ((flags & NOCD) ? savestring (list->word->word) : current_directory); - dirs_builtin ((WORD_LIST *)NULL); - if (flags & NOCD) - free (current_directory); - return (EXECUTION_SUCCESS); - } - else - { - free (current_directory); - return (EXECUTION_FAILURE); - } - } - - /* Pop the directory stack, and then change to the new top of the stack. - If LIST is non-null it should consist of a word +N or -N, which says - what element to delete from the stack. The default is the top one. */ - int - popd_builtin (list) - WORD_LIST *list; - { - register int i; - long which; - int flags; - char direction; - char *which_word; - - which_word = (char *)NULL; - for (flags = 0, which = 0L, direction = '+'; list; list = list->next) - { - if (ISOPTION (list->word->word, 'n')) - { - flags |= NOCD; - } - else if (ISOPTION (list->word->word, '-')) - { - list = list->next; - break; - } - else if (((direction = list->word->word[0]) == '+') || direction == '-') - { - if (legal_number (list->word->word + 1, &which) == 0) - { - builtin_error (m_badarg, list->word->word); - builtin_usage (); - return (EXECUTION_FAILURE); - } - which_word = list->word->word; - } - else if (*list->word->word == '-') - { - bad_option (list->word->word); - builtin_usage (); - return (EXECUTION_FAILURE); - } - else - break; - } - - if (which > directory_list_offset || (directory_list_offset == 0 && which == 0)) - { - pushd_error (directory_list_offset, which_word ? which_word : ""); - return (EXECUTION_FAILURE); - } - - /* Handle case of no specification, or top of stack specification. */ - if ((direction == '+' && which == 0) || - (direction == '-' && which == directory_list_offset)) - { - i = ((flags & NOCD) == 0) ? cd_to_string (pushd_directory_list[directory_list_offset - 1]) - : EXECUTION_SUCCESS; - if (i != EXECUTION_SUCCESS) - return (i); - free (pushd_directory_list[--directory_list_offset]); - } - else - { - /* Since an offset other than the top directory was specified, - remove that directory from the list and shift the remainder - of the list into place. */ - i = (direction == '+') ? directory_list_offset - which : which; - free (pushd_directory_list[i]); - directory_list_offset--; - - /* Shift the remainder of the list into place. */ - for (; i < directory_list_offset; i++) - pushd_directory_list[i] = pushd_directory_list[i + 1]; - } - - dirs_builtin ((WORD_LIST *)NULL); - return (EXECUTION_SUCCESS); - } - - /* Print the current list of directories on the directory stack. */ - int - dirs_builtin (list) - WORD_LIST *list; - { - int flags, desired_index, index_flag, vflag; - long i; - char *temp, *w; - - for (flags = vflag = index_flag = 0, desired_index = -1, w = ""; list; list = list->next) - { - if (ISOPTION (list->word->word, 'l')) - { - flags |= LONGFORM; - } - else if (ISOPTION (list->word->word, 'c')) - { - flags |= CLEARSTAK; - } - else if (ISOPTION (list->word->word, 'v')) - { - vflag |= 2; - } - else if (ISOPTION (list->word->word, 'p')) - { - vflag |= 1; - } - else if (ISOPTION (list->word->word, '-')) - { - list = list->next; - break; - } - else if (*list->word->word == '+' || *list->word->word == '-') - { - int sign; - if (legal_number (w = list->word->word + 1, &i) == 0) - { - builtin_error (m_badarg, list->word->word); - builtin_usage (); - return (EXECUTION_FAILURE); - } - sign = (*list->word->word == '+') ? 1 : -1; - desired_index = get_dirstack_index (i, sign, &index_flag); - } - else - { - bad_option (list->word->word); - builtin_usage (); - return (EXECUTION_FAILURE); - } - } - - if (flags & CLEARSTAK) - { - clear_directory_stack (); - return (EXECUTION_SUCCESS); - } - - if (index_flag && (desired_index < 0 || desired_index > directory_list_offset)) - { - pushd_error (directory_list_offset, w); - return (EXECUTION_FAILURE); - } - - #define DIRSTACK_FORMAT(temp) \ - (flags & LONGFORM) ? temp : polite_directory_format (temp) - - /* The first directory printed is always the current working directory. */ - if (index_flag == 0 || (index_flag == 1 && desired_index == 0)) - { - temp = get_working_directory ("dirs"); - if (temp == 0) - temp = savestring (""); - if (vflag & 2) - printf ("%2d %s", 0, DIRSTACK_FORMAT (temp)); - else - printf ("%s", DIRSTACK_FORMAT (temp)); - free (temp); - if (index_flag) - { - putchar ('\n'); - return EXECUTION_SUCCESS; - } - } - - #define DIRSTACK_ENTRY(i) \ - (flags & LONGFORM) ? pushd_directory_list[i] \ - : polite_directory_format (pushd_directory_list[i]) - - /* Now print the requested directory stack entries. */ - if (index_flag) - { - if (vflag & 2) - printf ("%2d %s", directory_list_offset - desired_index, - DIRSTACK_ENTRY (desired_index)); - else - printf ("%s", DIRSTACK_ENTRY (desired_index)); - } - else - for (i = directory_list_offset - 1; i >= 0; i--) - if (vflag >= 2) - printf ("\n%2d %s", directory_list_offset - (int)i, DIRSTACK_ENTRY (i)); - else - printf ("%s%s", (vflag & 1) ? "\n" : " ", DIRSTACK_ENTRY (i)); - - putchar ('\n'); - fflush (stdout); - return (EXECUTION_SUCCESS); - } - - static void - pushd_error (offset, arg) - int offset; - char *arg; - { - if (offset == 0) - builtin_error ("directory stack empty"); - else if (arg) - builtin_error ("%s: bad directory stack index", arg); - else - builtin_error ("bad directory stack index"); - } - - static void - clear_directory_stack () - { - register int i; - - for (i = 0; i < directory_list_offset; i++) - free (pushd_directory_list[i]); - directory_list_offset = 0; - } - - /* Switch to the directory in NAME. This uses the cd_builtin to do the work, - so if the result is EXECUTION_FAILURE then an error message has already - been printed. */ - static int - cd_to_string (name) - char *name; - { - WORD_LIST *tlist; - int result; - - tlist = make_word_list (make_word (name), NULL); - result = cd_builtin (tlist); - dispose_words (tlist); - return (result); - } - - static int - change_to_temp (temp) - char *temp; - { - int tt; - - tt = temp ? cd_to_string (temp) : EXECUTION_FAILURE; - - if (tt == EXECUTION_SUCCESS) - dirs_builtin ((WORD_LIST *)NULL); - - return (tt); - } - - static void - add_dirstack_element (dir) - char *dir; - { - int j; - - if (directory_list_offset == directory_list_size) - { - j = (directory_list_size += 10) * sizeof (char *); - pushd_directory_list = (char **)xrealloc (pushd_directory_list, j); - } - pushd_directory_list[directory_list_offset++] = dir; - } - - static int - get_dirstack_index (ind, sign, indexp) - int ind, sign, *indexp; - { - if (indexp) - *indexp = sign > 0 ? 1 : 2; - - /* dirs +0 prints the current working directory. */ - /* dirs -0 prints last element in directory stack */ - if (ind == 0 && sign > 0) - return 0; - else if (ind == directory_list_offset) - { - if (indexp) - *indexp = sign > 0 ? 2 : 1; - return 0; - } - else - return (sign > 0 ? directory_list_offset - ind : ind); - } - - char * - get_dirstack_element (ind, sign) - int ind, sign; - { - int i; - - i = get_dirstack_index (ind, sign, (int *)NULL); - return (i < 0 || i > directory_list_offset) ? (char *)NULL - : pushd_directory_list[i]; - } - - void - set_dirstack_element (ind, sign, value) - int ind, sign; - char *value; - { - int i; - - i = get_dirstack_index (ind, sign, (int *)NULL); - if (ind == 0 || i < 0 || i > directory_list_offset) - return; - free (pushd_directory_list[i]); - pushd_directory_list[i] = savestring (value); - } - - WORD_LIST * - get_directory_stack () - { - register int i; - WORD_LIST *ret; - char *d, *t; - - for (ret = (WORD_LIST *)NULL, i = 0; i < directory_list_offset; i++) - { - d = polite_directory_format (pushd_directory_list[i]); - ret = make_word_list (make_word (d), ret); - } - /* Now the current directory. */ - d = get_working_directory ("dirstack"); - i = 0; /* sentinel to decide whether or not to free d */ - if (d == 0) - d = "."; - else - { - t = polite_directory_format (d); - /* polite_directory_format sometimes returns its argument unchanged. - If it does not, we can free d right away. If it does, we need to - mark d to be deleted later. */ - if (t != d) - { - free (d); - d = t; - } - else /* t == d, so d is what we want */ - i = 1; - } - ret = make_word_list (make_word (d), ret); - if (i) - free (d); - return ret; /* was (REVERSE_LIST (ret, (WORD_LIST *)); */ - } - - static char *dirs_doc[] = { - "Display the list of currently remembered directories. Directories", - "find their way onto the list with the `pushd' command; you can get", - "back up through the list with the `popd' command.", - "", - "The -l flag specifies that `dirs' should not print shorthand versions", - "of directories which are relative to your home directory. This means", - "that `~/bin' might be displayed as `/homes/bfox/bin'. The -v flag", - "causes `dirs' to print the directory stack with one entry per line,", - "prepending the directory name with its position in the stack. The -p", - "flag does the same thing, but the stack position is not prepended.", - "The -c flag clears the directory stack by deleting all of the elements.", - "", - "+N displays the Nth entry counting from the left of the list shown by", - " dirs when invoked without options, starting with zero.", - "", - "-N displays the Nth entry counting from the right of the list shown by", - " dirs when invoked without options, starting with zero.", - (char *)NULL - }; - - static char *pushd_doc[] = { - "Adds a directory to the top of the directory stack, or rotates", - "the stack, making the new top of the stack the current working", - "directory. With no arguments, exchanges the top two directories.", - "", - "+N Rotates the stack so that the Nth directory (counting", - " from the left of the list shown by `dirs', starting with" - " zero) is at the top.", - "", - "-N Rotates the stack so that the Nth directory (counting", - " from the right of the list shown by `dirs', starting with" - " zero) is at the top.", - "", - "-n suppress the normal change of directory when adding directories", - " to the stack, so only the stack is manipulated.", - "", - "dir adds DIR to the directory stack at the top, making it the", - " new current working directory.", - "", - "You can see the directory stack with the `dirs' command.", - (char *)NULL - }; - - static char *popd_doc[] = { - "Removes entries from the directory stack. With no arguments,", - "removes the top directory from the stack, and cd's to the new", - "top directory.", - "", - "+N removes the Nth entry counting from the left of the list", - " shown by `dirs', starting with zero. For example: `popd +0'", - " removes the first directory, `popd +1' the second.", - "", - "-N removes the Nth entry counting from the right of the list", - " shown by `dirs', starting with zero. For example: `popd -0'", - " removes the last directory, `popd -1' the next to last.", - "", - "-n suppress the normal change of directory when removing directories", - " from the stack, so only the stack is manipulated.", - "", - "You can see the directory stack with the `dirs' command.", - (char *)NULL - }; - - struct builtin pushd_struct = { - "pushd", - pushd_builtin, - BUILTIN_ENABLED, - pushd_doc, - "pushd [+N | -N] [-n] [dir]", - 0 - }; - - struct builtin popd_struct = { - "popd", - popd_builtin, - BUILTIN_ENABLED, - popd_doc, - "popd [+N | -N] [-n]", - 0 - }; - - struct builtin dirs_struct = { - "dirs", - dirs_builtin, - BUILTIN_ENABLED, - dirs_doc, - "dirs [-clpv] [+N] [-N]", - 0 - }; --- 0 ---- diff -aNrc2 bash-2.02.1/examples/loadables/sleep.c bash-2.03/examples/loadables/sleep.c *** bash-2.02.1/examples/loadables/sleep.c Fri Mar 22 11:34:16 1996 --- bash-2.03/examples/loadables/sleep.c Mon May 11 11:44:02 1998 *************** *** 61,64 **** --- 61,66 ---- * An incredibly simplistic floating point converter. */ + static int multiplier[7] = { 1, 100000, 10000, 1000, 100, 10, 1 }; + static int convert(s, sp, usp) *************** *** 96,111 **** /* Now convert to millionths */ ! if (n == 1) ! usec *= 100000; ! else if (n == 2) ! usec *= 10000; ! else if (n == 3) ! usec *= 1000; ! else if (n == 4) ! usec *= 100; ! else if (n == 5) ! usec *= 10; ! else if (n == 6 && p[6] && isdigit(p[6]) && p[6] >= '5') usec++; /* round up 1 */ RETURN(1); } --- 98,106 ---- /* Now convert to millionths */ ! usec *= multiplier[n]; ! ! if (n == 6 && p[6] && isdigit(p[6]) && p[6] >= '5') usec++; /* round up 1 */ + RETURN(1); } diff -aNrc2 bash-2.02.1/examples/loadables/sync.c bash-2.03/examples/loadables/sync.c *** bash-2.02.1/examples/loadables/sync.c Wed Dec 31 19:00:00 1969 --- bash-2.03/examples/loadables/sync.c Tue May 5 15:44:55 1998 *************** *** 0 **** --- 1,32 ---- + /* sync - sync the disks by forcing pending filesystem writes to complete */ + + #include + + #ifdef HAVE_UNISTD_H + #include + #endif + + #include "builtins.h" + #include "shell.h" + #include "bashgetopt.h" + + sync_builtin (list) + WORD_LIST *list; + { + sync(); + return (EXECUTION_SUCCESS); + } + + char *sync_doc[] = { + "force completion of pending disk writes", + (char *)NULL + }; + + struct builtin sync_struct = { + "sync", /* builtin name */ + sync_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + sync_doc, /* array of long documentation strings. */ + "sync", /* usage synopsis; becomes short_doc */ + 0 /* reserved for internal use */ + }; diff -aNrc2 bash-2.02.1/examples/loadables/template.c bash-2.03/examples/loadables/template.c *** bash-2.02.1/examples/loadables/template.c Wed Dec 31 19:00:00 1969 --- bash-2.03/examples/loadables/template.c Thu May 7 11:23:02 1998 *************** *** 0 **** --- 1,56 ---- + /* template - example template for loadable builtin */ + + /* See Makefile for compilation details. */ + + #include + + #if defined (HAVE_UNISTD_H) + # include + #endif + #include "bashansi.h" + #include + #include + + #include "builtins.h" + #include "shell.h" + #include "bashgetopt.h" + + #if !defined (errno) + extern int errno; + #endif + + extern char *strerror (); + + template_builtin (list) + WORD_LIST *list; + { + int opt, rval; + + rval = EXECUTION_SUCCESS; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "")) != -1) + { + switch (opt) + { + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + return (rval); + } + + char *template_doc[] = { + (char *)NULL + }; + + struct builtin template_struct = { + "template", /* builtin name */ + template_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + template_doc, /* array of long documentation strings. */ + "template", /* usage synopsis; becomes short_doc */ + 0 /* reserved for internal use */ + }; diff -aNrc2 bash-2.02.1/examples/loadables/uname.c bash-2.03/examples/loadables/uname.c *** bash-2.02.1/examples/loadables/uname.c Wed Dec 31 19:00:00 1969 --- bash-2.03/examples/loadables/uname.c Tue May 5 15:39:37 1998 *************** *** 0 **** --- 1,139 ---- + /* + * uname - print system information + * + * usage: uname [-amnrsv] + * + */ + + #include + #include + + #include "bashtypes.h" + + #if defined (HAVE_UNAME) + # include + #else + struct utsname { + char sysname[32]; + char nodename[32]; + char release[32]; + char version[32]; + char machine[32]; + }; + #endif + + #include + + #include "builtins.h" + #include "shell.h" + #include "bashgetopt.h" + + #define FLAG_SYSNAME 0x01 /* -s */ + #define FLAG_NODENAME 0x02 /* -n */ + #define FLAG_RELEASE 0x04 /* -r */ + #define FLAG_VERSION 0x08 /* -v */ + #define FLAG_MACHINE 0x10 /* -m, -p */ + + #define FLAG_ALL 0x1f + + #ifndef errno + extern int errno; + #endif + + static void uprint(); + + static int uname_flags; + + uname_builtin (list) + WORD_LIST *list; + { + int opt, r; + struct utsname uninfo; + + uname_flags = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "amnprsv")) != -1) + { + switch (opt) + { + case 'a': + uname_flags |= FLAG_ALL; + break; + case 'm': + case 'p': + uname_flags |= FLAG_MACHINE; + break; + case 'n': + uname_flags |= FLAG_NODENAME; + break; + case 'r': + uname_flags |= FLAG_RELEASE; + break; + case 's': + uname_flags |= FLAG_SYSNAME; + break; + case 'v': + uname_flags |= FLAG_VERSION; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + if (list) + { + builtin_usage (); + return (EX_USAGE); + } + + if (uname_flags == 0) + uname_flags = FLAG_SYSNAME; + + /* Only ancient systems will not have uname(2). */ + #ifdef HAVE_UNAME + if (uname (&uninfo) < 0) + { + builtin_error ("cannot get system name: %s", strerror (errno)); + return (EXECUTION_FAILURE); + } + #else + builtin_error ("cannot get system information: uname(2) not available"); + return (EXECUTION_FAILURE); + #endif + + uprint (FLAG_SYSNAME, uninfo.sysname); + uprint (FLAG_NODENAME, uninfo.nodename); + uprint (FLAG_RELEASE, uninfo.release); + uprint (FLAG_VERSION, uninfo.version); + uprint (FLAG_MACHINE, uninfo.machine); + + return (EXECUTION_SUCCESS); + } + + static void + uprint (flag, info) + int flag; + char *info; + { + if (uname_flags & flag) + { + uname_flags &= ~flag; + printf ("%s%c", info, uname_flags ? ' ' : '\n'); + } + } + + char *uname_doc[] = { + "display information about the system", + (char *)NULL + }; + + struct builtin uname_struct = { + "uname", + uname_builtin, + BUILTIN_ENABLED, + uname_doc, + "uname [-amnrsv]", + 0 + }; diff -aNrc2 bash-2.02.1/examples/loadables/unlink.c bash-2.03/examples/loadables/unlink.c *** bash-2.02.1/examples/loadables/unlink.c Wed Dec 31 19:00:00 1969 --- bash-2.03/examples/loadables/unlink.c Fri Nov 13 13:21:28 1998 *************** *** 0 **** --- 1,52 ---- + /* unlink - remove a directory entry */ + + /* Should only be used to remove directories by a superuser prepared to let + fsck clean up the file system. */ + + #include + + #ifdef HAVE_UNISTD_H + #include + #endif + + #include + #include + + #include "builtins.h" + #include "shell.h" + + #ifndef errno + extern int errno; + #endif + + unlink_builtin (list) + WORD_LIST *list; + { + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + if (unlink (list->word->word) != 0) + { + builtin_error ("%s: cannot unlink: %s", list->word->word, strerror (errno)); + return (EXECUTION_FAILURE); + } + + return (EXECUTION_SUCCESS); + } + + char *unlink_doc[] = { + "Remove a directory entry.", + (char *)NULL + }; + + struct builtin unlink_struct = { + "unlink", /* builtin name */ + unlink_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + unlink_doc, /* array of long documentation strings. */ + "unlink name", /* usage synopsis; becomes short_doc */ + 0 /* reserved for internal use */ + }; diff -aNrc2 bash-2.02.1/examples/loadables/whoami.c bash-2.03/examples/loadables/whoami.c *** bash-2.02.1/examples/loadables/whoami.c Wed Dec 31 19:00:00 1969 --- bash-2.03/examples/loadables/whoami.c Tue May 5 14:52:05 1998 *************** *** 0 **** --- 1,52 ---- + /* + * whoami - print out username of current user + */ + + #include + #include + + #include "builtins.h" + #include "shell.h" + #include "bashgetopt.h" + + whoami_builtin (list) + WORD_LIST *list; + { + int opt; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "")) != -1) + { + switch (opt) + { + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + if (list) + { + builtin_usage (); + return (EX_USAGE); + } + + if (current_user.user_name == 0) + get_current_user_info (); + printf ("%s\n", current_user.user_name); + return (EXECUTION_SUCCESS); + } + + char *whoami_doc[] = { + "display name of current user", + (char *)NULL + }; + + struct builtin whoami_struct = { + "whoami", + whoami_builtin, + BUILTIN_ENABLED, + whoami_doc, + "whoami", + 0 + }; diff -aNrc2 bash-2.02.1/examples/misc/aliasconv.bash bash-2.03/examples/misc/aliasconv.bash *** bash-2.02.1/examples/misc/aliasconv.bash Fri Jul 19 14:49:43 1996 --- bash-2.03/examples/misc/aliasconv.bash Mon Nov 23 15:05:16 1998 *************** *** 1,7 **** #! /bin/bash # ! # alias-conv.sh - convert csh aliases to bash aliases and functions # ! # usage: alias-conv.sh # # Chet Ramey --- 1,7 ---- #! /bin/bash # ! # aliasconv.bash - convert csh aliases to bash aliases and functions # ! # usage: aliasconv.bash # # Chet Ramey *************** *** 28,32 **** EOF ! sed "s/^\([a-zA-Z0-9_-]*\)$T\(.*\)$/mkalias \1 '\2'/" >>/tmp/cb$$.1 $BASH /tmp/cb$$.1 | sed -e 's/\$cwd/\$PWD/g' \ --- 28,36 ---- EOF ! # the first thing we want to do is to protect single quotes in the alias, ! # since they whole thing is going to be surrounded by single quotes when ! # passed to mkalias ! ! sed -e "s:':\\'\\\'\\':" -e "s/^\([a-zA-Z0-9_-]*\)$T\(.*\)$/mkalias \1 '\2'/" >>/tmp/cb$$.1 $BASH /tmp/cb$$.1 | sed -e 's/\$cwd/\$PWD/g' \ diff -aNrc2 bash-2.02.1/examples/misc/aliasconv.sh bash-2.03/examples/misc/aliasconv.sh *** bash-2.02.1/examples/misc/aliasconv.sh Fri Jul 19 14:49:36 1996 --- bash-2.03/examples/misc/aliasconv.sh Mon Nov 23 15:05:24 1998 *************** *** 1,7 **** #! /bin/bash # ! # alias-conv.sh - convert csh aliases to bash aliases and functions # ! # usage: alias-conv.sh # # Chet Ramey --- 1,7 ---- #! /bin/bash # ! # aliasconv.sh - convert csh aliases to bash aliases and functions # ! # usage: aliasconv.sh # # Chet Ramey *************** *** 28,32 **** EOF ! sed "s/^\([a-zA-Z0-9_-]*\)$T\(.*\)$/mkalias \1 '\2'/" >>/tmp/cb$$.1 sh /tmp/cb$$.1 | sed -e 's/\$cwd/\$PWD/g' \ --- 28,36 ---- EOF ! # the first thing we want to do is to protect single quotes in the alias, ! # since they whole thing is going to be surrounded by single quotes when ! # passed to mkalias ! ! sed -e "s:':\\'\\\'\\':" -e "s/^\([a-zA-Z0-9_-]*\)$T\(.*\)$/mkalias \1 '\2'/" >>/tmp/cb$$.1 sh /tmp/cb$$.1 | sed -e 's/\$cwd/\$PWD/g' \ diff -aNrc2 bash-2.02.1/examples/scripts/adventure.sh bash-2.03/examples/scripts/adventure.sh *** bash-2.02.1/examples/scripts/adventure.sh Tue Oct 22 15:17:42 1991 --- bash-2.03/examples/scripts/adventure.sh Wed May 20 12:24:46 1998 *************** *** 91,94 **** --- 91,99 ---- ash_rm(){ echo " $1 " | sed -e "s/ $2 / /" -e 's/^ //' -e 's/ $//'; } + # enable history, bang history expansion, and emacs editing + set -o history + set -o histexpand + set -o emacs + cd LIM=.limbo # $HOME/$LIM contains "destroyed" objects *************** *** 165,170 **** fi ! echo -n '-advsh> ' # prompt ! read verb obj x if [ $? != 0 ] then verb=quit # EOF --- 170,174 ---- fi ! read -e -p '-advsh> ' verb obj x # prompt is '-advsh> ' if [ $? != 0 ] then verb=quit # EOF diff -aNrc2 bash-2.02.1/execute_cmd.c bash-2.03/execute_cmd.c *** bash-2.02.1/execute_cmd.c Fri Jul 10 11:49:07 1998 --- bash-2.03/execute_cmd.c Tue Jan 26 16:23:49 1999 *************** *** 738,741 **** --- 738,748 ---- the function to be waited for twice. */ exec_result = wait_for (last_made_pid); + #if defined (RECYCLES_PIDS) + /* LynxOS, for one, recycles pids very quickly -- so quickly + that a new process may have the same pid as the last one + created. This has been reported to fix the problem. */ + if (exec_result == 0) + last_made_pid = NO_PID; + #endif } } *************** *** 864,869 **** default: ! programming_error ! ("execute_command: bad command type `%d'", command->type); } --- 871,875 ---- default: ! command_error ("execute_command", CMDERR_BADTYPE, command->type, 0); } *************** *** 906,910 **** d->tv_sec -= 1; if (d->tv_sec < 0) /* ??? -- BSD/OS does this */ ! d->tv_sec = 0; } return d; --- 912,919 ---- d->tv_sec -= 1; if (d->tv_sec < 0) /* ??? -- BSD/OS does this */ ! { ! d->tv_sec = 0; ! d->tv_usec = 0; ! } } return d; *************** *** 917,921 **** d->tv_sec = t1->tv_sec + t2->tv_sec; d->tv_usec = t1->tv_usec + t2->tv_usec; ! if (d->tv_usec > 1000000) { d->tv_usec -= 1000000; --- 926,930 ---- d->tv_sec = t1->tv_sec + t2->tv_sec; d->tv_usec = t1->tv_usec + t2->tv_usec; ! if (d->tv_usec >= 1000000) { d->tv_usec -= 1000000; *************** *** 1473,1477 **** default: ! programming_error ("execute_connection: bad connector `%d'", command->value.Connection->connector); jump_to_top_level (DISCARD); exec_result = EXECUTION_FAILURE; --- 1482,1486 ---- default: ! command_error ("execute_connection", CMDERR_BADCONN, command->value.Connection->connector, 0); jump_to_top_level (DISCARD); exec_result = EXECUTION_FAILURE; *************** *** 2063,2067 **** result = 0; ! this_command_name = "(("; /* If we're in a function, update the line number information. */ if (variable_context) --- 2072,2076 ---- result = 0; ! this_command_name = "(("; /* )) */ /* If we're in a function, update the line number information. */ if (variable_context) *************** *** 2093,2097 **** COND_COM *cond; { ! int result, invert, patmatch; char *arg1, *arg2, *print2; --- 2102,2106 ---- COND_COM *cond; { ! int result, invert, patmatch, flags; char *arg1, *arg2, *print2; *************** *** 2125,2130 **** else if (cond->type == COND_BINARY) { ! patmatch = (cond->op->word[1] == '=') && (cond->op->word[2] == '\0') && ! (cond->op->word[0] == '!' || cond->op->word[0] == '='); arg1 = cond_expand_word (cond->left->op, 0); --- 2134,2140 ---- else if (cond->type == COND_BINARY) { ! patmatch = ((cond->op->word[1] == '=') && (cond->op->word[2] == '\0') && ! (cond->op->word[0] == '!' || cond->op->word[0] == '=') || ! (cond->op->word[0] == '=' && cond->op->word[1] == '\0')); arg1 = cond_expand_word (cond->left->op, 0); *************** *** 2148,2152 **** else { ! programming_error ("execute_cond_node: %d: unknown conditional command type", cond->type); jump_to_top_level (DISCARD); result = EXECUTION_FAILURE; --- 2158,2162 ---- else { ! command_error ("execute_cond_node", CMDERR_BADTYPE, cond->type, 0); jump_to_top_level (DISCARD); result = EXECUTION_FAILURE; *************** *** 2263,2267 **** for (w = words; w; w = w->next) if (w->word->flags & W_ASSIGNMENT) ! w->word->flags |= W_NOSPLIT; } --- 2273,2277 ---- for (w = words; w; w = w->next) if (w->word->flags & W_ASSIGNMENT) ! w->word->flags |= (W_NOSPLIT|W_NOGLOB); } *************** *** 2278,2282 **** char *command_line, *lastarg, *temp; int first_word_quoted, result, builtin_is_special, already_forked, dofork; ! pid_t old_last_command_subst_pid; Function *builtin; SHELL_VAR *func; --- 2288,2292 ---- char *command_line, *lastarg, *temp; int first_word_quoted, result, builtin_is_special, already_forked, dofork; ! pid_t old_last_command_subst_pid, old_last_async_pid; Function *builtin; SHELL_VAR *func; *************** *** 2298,2301 **** --- 2308,2312 ---- old_last_command_subst_pid = last_command_subst_pid; + old_last_async_pid = last_asynchronous_pid; already_forked = dofork = 0; *************** *** 2328,2331 **** --- 2339,2343 ---- pipe_in = pipe_out = -1; + last_asynchronous_pid = old_last_async_pid; subshell_environment = async ? SUBSHELL_ASYNC : SUBSHELL_FORK; } *************** *** 2771,2779 **** int flags; { ! int result, r; /* A subshell is neither a login shell nor interactive. */ login_shell = interactive = 0; subshell_environment = SUBSHELL_ASYNC; --- 2783,2794 ---- int flags; { ! int result, r, jobs_hack; /* A subshell is neither a login shell nor interactive. */ login_shell = interactive = 0; + jobs_hack = (builtin == jobs_builtin) && + ((subshell_environment & SUBSHELL_ASYNC) == 0 || pipe_out != NO_PIPE); + subshell_environment = SUBSHELL_ASYNC; *************** *** 2786,2791 **** /* Allow the output of `jobs' to be piped. */ ! if (builtin == jobs_builtin && !async && ! (pipe_out != NO_PIPE || pipe_in != NO_PIPE)) kill_current_pipeline (); else --- 2801,2805 ---- /* Allow the output of `jobs' to be piped. */ ! if (jobs_hack) kill_current_pipeline (); else *************** *** 2899,2902 **** --- 2913,2920 ---- setup_async_signals () { + #if defined (__BEOS__) + set_signal_handler (SIGHUP, SIG_IGN); /* they want csh-like behavior */ + #endif + #if defined (JOB_CONTROL) if (job_control == 0) diff -aNrc2 bash-2.02.1/externs.h bash-2.03/externs.h *** bash-2.02.1/externs.h Tue Feb 24 15:51:02 1998 --- bash-2.03/externs.h Thu Sep 3 15:08:17 1998 *************** *** 50,53 **** --- 50,54 ---- #if defined (RESTRICTED_SHELL) + extern int shell_is_restricted __P((char *)); extern int maybe_make_restricted __P((char *)); #endif *************** *** 117,120 **** --- 118,122 ---- /* Declarations for functions defined in lib/sh/itos.c */ + extern char *inttostr __P((int, char *, int)); extern char *itos __P((int)); diff -aNrc2 bash-2.02.1/flags.c bash-2.03/flags.c *** bash-2.02.1/flags.c Tue Nov 18 11:26:39 1997 --- bash-2.03/flags.c Thu Sep 3 14:45:37 1998 *************** *** 130,134 **** unsetting or resetting the values of $PATH and $SHELL, and any type of output redirection. */ ! int restricted = 0; #endif /* RESTRICTED_SHELL */ --- 130,135 ---- unsetting or resetting the values of $PATH and $SHELL, and any type of output redirection. */ ! int restricted = 0; /* currently restricted */ ! int restricted_shell = 0; /* shell was started in restricted mode. */ #endif /* RESTRICTED_SHELL */ diff -aNrc2 bash-2.02.1/flags.h bash-2.03/flags.h *** bash-2.02.1/flags.h Thu Apr 17 09:51:35 1997 --- bash-2.03/flags.h Thu Sep 3 14:46:30 1998 *************** *** 62,65 **** --- 62,66 ---- #if defined (RESTRICTED_SHELL) extern int restricted; + extern int restricted_shell; #endif /* RESTRICTED_SHELL */ diff -aNrc2 bash-2.02.1/general.c bash-2.03/general.c *** bash-2.02.1/general.c Tue Feb 24 15:51:25 1998 --- bash-2.03/general.c Tue Dec 1 16:05:49 1998 *************** *** 153,156 **** --- 153,163 ---- if (rest >= 500) *sfp += 1; + + /* Sanity check */ + if (*sfp >= 1000) + { + *sp += 1; + *sfp -= 1000; + } } *************** *** 190,193 **** --- 197,207 ---- *sp = t / clk_tck; + + /* Sanity check */ + if (*sfp >= 1000) + { + *sp += 1; + *sfp -= 1000; + } } *************** *** 348,353 **** } ! /* There is a bug in the NeXT 2.1 rlogind that causes opens ! of /dev/tty to fail. */ void check_dev_tty () --- 362,375 ---- } ! /* There is a bug in the NeXT 2.1 rlogind that causes opens ! of /dev/tty to fail. */ ! ! #if defined (__BEOS__) ! /* On BeOS, opening in non-blocking mode exposes a bug in BeOS, so turn it ! into a no-op. This should probably go away in the future. */ ! # undef O_NONBLOCK ! # define O_NONBLOCK 0 ! #endif /* __BEOS__ */ ! void check_dev_tty () *************** *** 621,629 **** } ! #if 1 ! /* Turn `//' into `/' -- XXX experimental */ ! if (result[0] == '/' && result[1] == '/' && result[2] == '\0') ! result[1] = '\0'; ! #endif return (result); --- 643,661 ---- } ! /* If the result starts with `//', but the original path does not, we ! can turn the // into /. */ ! if ((result[0] == '/' && result[1] == '/' && result[2] != '/') && ! (path[0] != '/' || path[1] != '/' || path[2] == '/')) ! { ! char *r2; ! if (result[2] == '\0') /* short-circuit for bare `//' */ ! result[1] = '\0'; ! else ! { ! r2 = savestring (result + 1); ! free (result); ! result = r2; ! } ! } return (result); *************** *** 743,747 **** } dlen = strlen (current_dir); ! current_dir[dlen++] = '/'; /* Turn /foo/./bar into /foo/bar. */ --- 775,780 ---- } dlen = strlen (current_dir); ! if (current_dir[0] == '/' && dlen > 1) ! current_dir[dlen++] = '/'; /* Turn /foo/./bar into /foo/bar. */ *************** *** 1055,1060 **** --- 1088,1127 ---- group_vector[i] = nbuf; } + if (ngp) *ngp = ngroups; return group_vector; + } + + int * + get_group_array (ngp) + int *ngp; + { + int i; + static int *group_iarray = (int *)NULL; + + if (group_iarray) + { + if (ngp) + *ngp = ngroups; + return (group_iarray); + } + + if (ngroups == 0) + initialize_group_array (); + + if (ngroups <= 0) + { + if (ngp) + *ngp = 0; + return (int *)NULL; + } + + group_iarray = (int *)xmalloc (ngroups * sizeof (int)); + for (i = 0; i < ngroups; i++) + group_iarray[i] = (int)group_array[i]; + + if (ngp) + *ngp = ngroups; + return group_iarray; } diff -aNrc2 bash-2.02.1/general.h bash-2.03/general.h *** bash-2.02.1/general.h Tue Feb 24 15:51:04 1998 --- bash-2.03/general.h Tue May 5 13:12:07 1998 *************** *** 222,225 **** --- 222,226 ---- extern int group_member __P((gid_t)); extern char **get_group_list __P((int *)); + extern int *get_group_array __P((int *)); #endif /* _GENERAL_H_ */ diff -aNrc2 bash-2.02.1/hashlib.c bash-2.03/hashlib.c *** bash-2.02.1/hashlib.c Tue Nov 18 11:37:08 1997 --- bash-2.03/hashlib.c Tue Apr 28 13:54:33 1998 *************** *** 68,71 **** --- 68,74 ---- for STRING. TABLE is a pointer to a HASH_TABLE. */ + /* A possibly better distribution may be obtained by initializing i to + ~0UL and using i = (i * 33) + *string++ as the step */ + #define ALL_ONES (~((unsigned long) 0)) #define BITS(h, n) ((unsigned long)(h) & ~(ALL_ONES << (n))) diff -aNrc2 bash-2.02.1/jobs.c bash-2.03/jobs.c *** bash-2.02.1/jobs.c Tue Jun 30 12:35:46 1998 --- bash-2.03/jobs.c Thu Dec 10 14:01:15 1998 *************** *** 108,111 **** --- 108,115 ---- #endif /* !errno */ + #if !defined (CHILD_MAX) + # define CHILD_MAX 32 + #endif + /* Take care of system dependencies that must be handled when waiting for children. The arguments to the WAITPID macro match those to the Posix.1 *************** *** 544,553 **** for (i = 0; i < job_slots; i++) - #if 0 - if (jobs[i] && DEADJOB (i) && IS_NOTIFIED (i) && - (interactive_shell || (find_last_pid (i) != last_asynchronous_pid))) - #else if (jobs[i] && DEADJOB (i) && IS_NOTIFIED (i)) - #endif delete_job (i, 0); --- 548,552 ---- *************** *** 1151,1157 **** /* In the child. Give this child the right process group, set the signals to the default state for a new process. */ ! pid_t mine; ! mine = getpid (); #if defined (BUFFERED_INPUT) /* Close default_buffered_input if it's > 0. We don't close it if it's --- 1150,1156 ---- /* In the child. Give this child the right process group, set the signals to the default state for a new process. */ ! pid_t mypid; ! mypid = getpid (); #if defined (BUFFERED_INPUT) /* Close default_buffered_input if it's > 0. We don't close it if it's *************** *** 1170,1174 **** if (pipeline_pgrp == 0) /* This is the first child. */ ! pipeline_pgrp = mine; /* Check for running command in backquotes. */ --- 1169,1173 ---- if (pipeline_pgrp == 0) /* This is the first child. */ ! pipeline_pgrp = mypid; /* Check for running command in backquotes. */ *************** *** 1186,1195 **** B.4.3.3, p. 237 also covers this, in the context of job control shells. */ ! if (setpgid (mine, pipeline_pgrp) < 0) ! sys_error ("child setpgid (%d to %d)", mine, pipeline_pgrp); #if defined (PGRP_PIPE) ! if (pipeline_pgrp == mine) { #endif if (async_p == 0 && pipeline_pgrp != shell_pgrp) give_terminal_to (pipeline_pgrp); --- 1185,1200 ---- B.4.3.3, p. 237 also covers this, in the context of job control shells. */ ! if (setpgid (mypid, pipeline_pgrp) < 0) ! sys_error ("child setpgid (%d to %d)", mypid, pipeline_pgrp); #if defined (PGRP_PIPE) ! if (pipeline_pgrp == mypid) { #endif + /* XXX - By convention (and assumption above), if + pipeline_pgrp == shell_pgrp, we are making a child for + command substitution. + In this case, we don't want to give the terminal to the + shell's process group (we could be in the middle of a + pipeline, for example). */ if (async_p == 0 && pipeline_pgrp != shell_pgrp) give_terminal_to (pipeline_pgrp); *************** *** 1472,1485 **** r = wait_for (pid); ! /* POSIX.2: if we just waited for $!, we can remove the job from the ! jobs table. */ ! if (pid == last_asynchronous_pid) ! { ! BLOCK_CHILD (set, oset); ! job = find_job (pid); ! if (job != NO_JOB && jobs[job] && DEADJOB (job)) ! jobs[job]->flags |= J_NOTIFIED; ! UNBLOCK_CHILD (oset); ! } return r; --- 1477,1487 ---- r = wait_for (pid); ! /* POSIX.2: if we just waited for a job, we can remove it from the jobs ! table. */ ! BLOCK_CHILD (set, oset); ! job = find_job (pid); ! if (job != NO_JOB && jobs[job] && DEADJOB (job)) ! jobs[job]->flags |= J_NOTIFIED; ! UNBLOCK_CHILD (oset); return r; *************** *** 1522,1525 **** --- 1524,1532 ---- } } + + /* POSIX.2 says the shell can discard the statuses of all completed jobs if + `wait' is called with no arguments. */ + mark_dead_jobs_as_notified (1); + cleanup_dead_jobs (); } *************** *** 1723,1727 **** if (job == NO_JOB || IS_JOBCONTROL (job)) ! give_terminal_to (shell_pgrp); /* If the command did not exit cleanly, or the job is just --- 1730,1754 ---- if (job == NO_JOB || IS_JOBCONTROL (job)) ! { ! /* XXX - under what circumstances is a job not present in the jobs ! table (job == NO_JOB)? ! 1. command substitution ! ! In the case of command substitution, at least, it's probably not ! the right thing to give the terminal to the shell's process group, ! even though there is code in subst.c:command_substitute to work ! around it. ! ! Things that don't: ! $PROMPT_COMMAND execution ! process substitution ! */ ! #if 0 ! if (job == NO_JOB) ! itrace("wait_for: job == NO_JOB, giving the terminal to shell_pgrp (%d)", shell_pgrp); ! #endif ! ! give_terminal_to (shell_pgrp); ! } /* If the command did not exit cleanly, or the job is just *************** *** 1776,1786 **** message about the job's termination, and so delete_job really clears the slot in the jobs table. */ - #if 0 - if (DEADJOB (job)) - jobs[job]->flags |= J_NOTIFIED; - cleanup_dead_jobs (); - #else notify_and_cleanup (); - #endif } } --- 1803,1807 ---- *************** *** 1811,1823 **** r = wait_for (pid); ! /* POSIX.2: if we just waited for $!, we can remove the job from the ! jobs table. */ ! if (pid == last_asynchronous_pid) ! { ! BLOCK_CHILD (set, oset); ! if (job != NO_JOB && jobs[job] && DEADJOB (job)) ! jobs[job]->flags |= J_NOTIFIED; ! UNBLOCK_CHILD (oset); ! } return r; --- 1832,1841 ---- r = wait_for (pid); ! /* POSIX.2: we can remove the job from the jobs table if we just waited ! for it. */ ! BLOCK_CHILD (set, oset); ! if (job != NO_JOB && jobs[job] && DEADJOB (job)) ! jobs[job]->flags |= J_NOTIFIED; ! UNBLOCK_CHILD (oset); return r; *************** *** 1845,1849 **** reap_dead_jobs () { ! mark_dead_jobs_as_notified (); cleanup_dead_jobs (); } --- 1863,1867 ---- reap_dead_jobs () { ! mark_dead_jobs_as_notified (0); cleanup_dead_jobs (); } *************** *** 2489,2503 **** termsig = WTERMSIG (s); /* If job control is disabled, don't print the status messages. Mark dead jobs as notified so that they get cleaned up. If startup_state == 2, we were started to run `-c command', so ! don't print anything. If the shell is not interactive, don't ! print anything unless the job was killed by a signal. */ ! if ((job_control == 0 && interactive_shell) || startup_state == 2 || ! (startup_state == 0 && WIFSIGNALED (s) == 0)) { - #if 0 - if (DEADJOB (job)) - #else /* POSIX.2 compatibility: if the shell is not interactive, hang onto the job corresponding to the last asynchronous --- 2507,2524 ---- termsig = WTERMSIG (s); + /* POSIX.2 says we have to hang onto the statuses of at most the + last CHILD_MAX background processes if the shell is running a + script. If the shell is not interactive, don't print anything + unless the job was killed by a signal. */ + if (startup_state == 0 && WIFSIGNALED (s) == 0 && + ((DEADJOB (job) && IS_FOREGROUND (job) == 0) || STOPPED (job))) + continue; + /* If job control is disabled, don't print the status messages. Mark dead jobs as notified so that they get cleaned up. If startup_state == 2, we were started to run `-c command', so ! don't print anything. */ ! if ((job_control == 0 && interactive_shell) || startup_state == 2) { /* POSIX.2 compatibility: if the shell is not interactive, hang onto the job corresponding to the last asynchronous *************** *** 2505,2509 **** a `wait'. */ if (DEADJOB (job) && (interactive_shell || (find_last_pid (job) != last_asynchronous_pid))) - #endif jobs[job]->flags |= J_NOTIFIED; continue; --- 2526,2529 ---- *************** *** 2517,2523 **** case JDEAD: if (interactive_shell == 0 && termsig && WIFSIGNALED (s) && - #if 1 termsig != SIGINT && - #endif #if defined (DONT_REPORT_SIGPIPE) termsig != SIGPIPE && --- 2537,2541 ---- *************** *** 2944,2952 **** /* Mark all dead jobs as notified, so delete_job () cleans them out ! of the job table properly. */ static void ! mark_dead_jobs_as_notified () { ! register int i; sigset_t set, oset; --- 2962,2973 ---- /* Mark all dead jobs as notified, so delete_job () cleans them out ! of the job table properly. POSIX.2 says we need to save the ! status of the last CHILD_MAX jobs, so we count the number of dead ! jobs and mark only enough as notified to save CHILD_MAX statuses. */ static void ! mark_dead_jobs_as_notified (force) ! int force; { ! register int i, ndead; sigset_t set, oset; *************** *** 2955,2965 **** BLOCK_CHILD (set, oset); for (i = 0; i < job_slots; i++) ! #if 0 ! if (jobs[i] && DEADJOB (i)) ! #else ! if (jobs[i] && DEADJOB (i) && (interactive_shell || (find_last_pid (i) != last_asynchronous_pid))) ! #endif ! jobs[i]->flags |= J_NOTIFIED; UNBLOCK_CHILD (oset); --- 2976,3007 ---- BLOCK_CHILD (set, oset); + /* Count the number of dead jobs */ + for (i = ndead = 0; force == 0 && i < job_slots; i++) + { + if (jobs[i] && DEADJOB (i)) + ndead++; + } + + /* Don't do anything if the number of jobs is less than CHILD_MAX and + we're not forcing a cleanup. */ + if (force == 0 && ndead <= CHILD_MAX) + { + UNBLOCK_CHILD (oset); + return; + } + + /* Mark enough dead jobs as notified that we keep CHILD_MAX jobs in + the list. This isn't exactly right yet; changes need to be made + to stop_pipeline so we don't mark the newer jobs after we've + created CHILD_MAX slots in the jobs array. */ for (i = 0; i < job_slots; i++) ! { ! if (jobs[i] && DEADJOB (i) && (interactive_shell || (find_last_pid (i) != last_asynchronous_pid))) ! { ! jobs[i]->flags |= J_NOTIFIED; ! if (force == 0 && --ndead <= CHILD_MAX) ! break; ! } ! } UNBLOCK_CHILD (oset); diff -aNrc2 bash-2.02.1/lib/glob/Makefile.in bash-2.03/lib/glob/Makefile.in *** bash-2.02.1/lib/glob/Makefile.in Tue Sep 16 13:13:23 1997 --- bash-2.03/lib/glob/Makefile.in Thu Feb 18 12:13:19 1999 *************** *** 17,24 **** --- 17,27 ---- RANLIB = @RANLIB@ AR = @AR@ + ARFLAGS = @ARFLAGS@ RM = rm CP = cp MV = mv + SHELL = @MAKE_SHELL@ + CFLAGS = @CFLAGS@ LOCAL_CFLAGS = @LOCAL_CFLAGS@ *************** *** 67,71 **** $(LIBRARY_NAME): $(OBJECTS) $(RM) -f $@ ! $(AR) cr $@ $(OBJECTS) -test -n "$(RANLIB)" && $(RANLIB) $@ --- 70,74 ---- $(LIBRARY_NAME): $(OBJECTS) $(RM) -f $@ ! $(AR) $(ARFLAGS) $@ $(OBJECTS) -test -n "$(RANLIB)" && $(RANLIB) $@ diff -aNrc2 bash-2.02.1/lib/glob/fnmatch.c bash-2.03/lib/glob/fnmatch.c *** bash-2.02.1/lib/glob/fnmatch.c Tue Jun 30 12:28:08 1998 --- bash-2.03/lib/glob/fnmatch.c Thu Dec 31 15:04:33 1998 *************** *** 26,33 **** --- 26,40 ---- #include + #if defined (HAVE_STRING_H) + # include + #else + # include + #endif /* HAVE_STRING_H */ + static int gmatch (); static char *brackmatch (); #ifdef EXTENDED_GLOB static int extmatch (); + static char *patscan (); #endif *************** *** 156,164 **** #ifdef EXTENDED_GLOB if ((flags & FNM_EXTMATCH) && *p == '(' && (c == '+' || c == '*' || c == '?' || c == '@' || c == '!')) /* ) */ ! /* extmatch () will handle recursively calling gmatch, so we can ! just return what extmatch() returns. */ ! return (extmatch (c, n, se, p, pe, flags)); #endif --- 163,177 ---- #ifdef EXTENDED_GLOB + /* extmatch () will handle recursively calling gmatch, so we can + just return what extmatch() returns. */ if ((flags & FNM_EXTMATCH) && *p == '(' && (c == '+' || c == '*' || c == '?' || c == '@' || c == '!')) /* ) */ ! { ! int lflags; ! /* If we're not matching the start of the string, we're not ! concerned about the special cases for matching `.' */ ! lflags = (n == string) ? flags : (flags & ~FNM_PERIOD); ! return (extmatch (c, n, se, p, pe, lflags)); ! } #endif *************** *** 227,231 **** /* Handle ******(patlist) */ if ((flags & FNM_EXTMATCH) && c == '*' && *p == '(') /*)*/ ! return (extmatch (c, n, se, p, pe, flags)); #endif if (p == pe) --- 240,260 ---- /* Handle ******(patlist) */ if ((flags & FNM_EXTMATCH) && c == '*' && *p == '(') /*)*/ ! { ! char *newn; ! /* We need to check whether or not the extended glob ! pattern matches the remainder of the string. ! If it does, we match the entire pattern. */ ! for (newn = n; newn < se; ++newn) ! { ! if (extmatch (c, newn, se, p, pe, flags) == 0) ! return (0); ! } ! /* We didn't match the extended glob pattern, but ! that's OK, since we can match 0 or more occurrences. ! We need to skip the glob pattern and see if we ! match the rest of the string. */ ! newn = patscan (p, pe, 0); ! p = newn; ! } #endif if (p == pe) *************** *** 246,254 **** c1 = FOLD (c1); for (--p; n < se; ++n) ! /* Only call fnmatch if the first character indicates a ! possible match. */ ! if ((c == '[' || FOLD (*n) == c1) && ! gmatch (n, se, p, pe, flags & ~FNM_PERIOD) == 0) ! return (0); return FNM_NOMATCH; } --- 275,296 ---- c1 = FOLD (c1); for (--p; n < se; ++n) ! { ! /* Only call fnmatch if the first character indicates a ! possible match. We can check the first character if ! we're not doing an extended glob match. */ ! if ((flags & FNM_EXTMATCH) == 0 && c != '[' && FOLD (*n) != c1) ! continue; ! ! /* If we're doing an extended glob match and the pattern is not ! one of the extended glob patterns, we can check the first ! character. */ ! if ((flags & FNM_EXTMATCH) && p[1] != '(' && /*)*/ ! strchr ("?*+@!", *p) == 0 && c != '[' && FOLD (*n) != c1) ! continue; ! ! /* Otherwise, we just recurse. */ ! if (gmatch (n, se, p, pe, flags & ~FNM_PERIOD) == 0) ! return (0); ! } return FNM_NOMATCH; } diff -aNrc2 bash-2.02.1/lib/glob/fnmatch.h bash-2.03/lib/glob/fnmatch.h *** bash-2.02.1/lib/glob/fnmatch.h Thu Jul 31 15:34:29 1997 --- bash-2.03/lib/glob/fnmatch.h Fri Jun 5 15:14:17 1998 *************** *** 20,23 **** --- 20,25 ---- #define _FNMATCH_H 1 + #include "stdc.h" + /* We #undef these before defining them because some losing systems (HP-UX A.08.07 for example) define these in . */ *************** *** 42,46 **** /* Match STRING against the filename pattern PATTERN, returning zero if it matches, FNM_NOMATCH if not. */ ! extern int fnmatch(); #endif /* _FNMATCH_H */ --- 44,48 ---- /* Match STRING against the filename pattern PATTERN, returning zero if it matches, FNM_NOMATCH if not. */ ! extern int fnmatch __P((char *, char *, int)); #endif /* _FNMATCH_H */ diff -aNrc2 bash-2.02.1/lib/glob/glob.c bash-2.03/lib/glob/glob.c *** bash-2.02.1/lib/glob/glob.c Fri Jan 30 13:18:08 1998 --- bash-2.03/lib/glob/glob.c Thu Sep 17 13:12:34 1998 *************** *** 76,82 **** #endif /* _POSIX_SOURCE */ ! #if !defined (HAVE_BCOPY) # define bcopy(s, d, n) ((void) memcpy ((d), (s), (n))) ! #endif /* !HAVE_BCOPY */ #if defined (SHELL) --- 76,82 ---- #endif /* _POSIX_SOURCE */ ! #if !defined (HAVE_BCOPY) && !defined (bcopy) # define bcopy(s, d, n) ((void) memcpy ((d), (s), (n))) ! #endif /* !HAVE_BCOPY && !bcopy */ #if defined (SHELL) *************** *** 252,256 **** struct globval *lastlink; register struct globval *nextlink; ! register char *nextname; unsigned int count; int lose, skip; --- 252,256 ---- struct globval *lastlink; register struct globval *nextlink; ! register char *nextname, *npat; unsigned int count; int lose, skip; *************** *** 298,308 **** dirlen = strlen (dir); nextname = (char *)malloc (dirlen + strlen (pat) + 2); ! if (nextname == 0) lose = 1; else { strcpy (nextname, dir); nextname[dirlen++] = '/'; ! strcpy (nextname + dirlen, pat); if (GLOB_TESTNAME (nextname) >= 0) --- 298,312 ---- dirlen = strlen (dir); nextname = (char *)malloc (dirlen + strlen (pat) + 2); ! npat = (char *)malloc (strlen (pat) + 1); ! if (nextname == 0 || npat == 0) lose = 1; else { + strcpy (npat, pat); + dequote_pathname (npat); + strcpy (nextname, dir); nextname[dirlen++] = '/'; ! strcpy (nextname + dirlen, npat); if (GLOB_TESTNAME (nextname) >= 0) *************** *** 311,327 **** nextlink = (struct globval *)alloca (sizeof (struct globval)); nextlink->next = (struct globval *)0; ! nextname = (char *) malloc (strlen (pat) + 1); ! if (nextname == 0) ! lose = 1; ! else ! { ! lastlink = nextlink; ! nextlink->name = nextname; ! strcpy (nextname, pat); ! count = 1; ! } } else ! free (nextname); } --- 315,327 ---- nextlink = (struct globval *)alloca (sizeof (struct globval)); nextlink->next = (struct globval *)0; ! lastlink = nextlink; ! nextlink->name = npat; ! count = 1; } else ! { ! free (nextname); ! free (npat); ! } } *************** *** 378,381 **** --- 378,391 ---- /* If this directory entry is not to be used, try again. */ if (REAL_DIR_ENTRY (dp) == 0) + continue; + + /* If a leading dot need not be explicitly matched, and the pattern + doesn't start with a `.', don't match `.' or `..' */ + #define dname dp->d_name + if (noglob_dot_filenames == 0 && pat[0] != '.' && + (pat[0] != '\\' || pat[1] != '.') && + (dname[0] == '.' && + (dname[1] == '\0' || (dname[1] == '.' && dname[2] == '\0')))) + #undef dname continue; diff -aNrc2 bash-2.02.1/lib/malloc/Makefile.in bash-2.03/lib/malloc/Makefile.in *** bash-2.02.1/lib/malloc/Makefile.in Tue Sep 16 13:16:28 1997 --- bash-2.03/lib/malloc/Makefile.in Thu Feb 18 12:13:07 1999 *************** *** 14,21 **** --- 14,24 ---- RANLIB = @RANLIB@ AR = @AR@ + ARFLAGS = @ARFLAGS@ RM = rm -f CP = cp MV = mv + SHELL = @MAKE_SHELL@ + PROFILE_FLAGS = *************** *** 64,93 **** malloc: ${MALLOC_OBJS} ${RM} libmalloc.a ! ${AR} cr libmalloc.a ${MALLOC_OBJS} -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a nmalloc: ${NMALLOC_OBJS} ${RM} libmalloc.a ! ${AR} cr libmalloc.a ${NMALLOC_OBJS} -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a nmalloc2: ${NMALLOC2_OBJS} ${RM} libmalloc.a ! ${AR} cr libmalloc.a ${NMALLOC2_OBJS} -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a gmalloc: ${GMALLOC_OBJS} ${RM} libmalloc.a ! ${AR} cr libmalloc.a ${GMALLOC_OBJS} -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a ngmalloc: ${NGMALLOC_OBJS} ${RM} libmalloc.a ! ${AR} cr libmalloc.a ${NGMALLOC_OBJS} -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a stubmalloc: ${STUB_OBJS} ${RM} libmalloc.a ! ${AR} cr libmalloc.a ${STUB_OBJS} -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a --- 67,96 ---- malloc: ${MALLOC_OBJS} ${RM} libmalloc.a ! ${AR} ${ARFLAGS} libmalloc.a ${MALLOC_OBJS} -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a nmalloc: ${NMALLOC_OBJS} ${RM} libmalloc.a ! ${AR} ${ARFLAGS} libmalloc.a ${NMALLOC_OBJS} -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a nmalloc2: ${NMALLOC2_OBJS} ${RM} libmalloc.a ! ${AR} ${ARFLAGS} libmalloc.a ${NMALLOC2_OBJS} -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a gmalloc: ${GMALLOC_OBJS} ${RM} libmalloc.a ! ${AR} ${ARFLAGS} libmalloc.a ${GMALLOC_OBJS} -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a ngmalloc: ${NGMALLOC_OBJS} ${RM} libmalloc.a ! ${AR} ${ARFLAGS} libmalloc.a ${NGMALLOC_OBJS} -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a stubmalloc: ${STUB_OBJS} ${RM} libmalloc.a ! ${AR} ${ARFLAGS} libmalloc.a ${STUB_OBJS} -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a diff -aNrc2 bash-2.02.1/lib/malloc/malloc.c bash-2.03/lib/malloc/malloc.c *** bash-2.02.1/lib/malloc/malloc.c Tue Jun 30 12:09:29 1998 --- bash-2.03/lib/malloc/malloc.c Thu Jul 2 10:16:39 1998 *************** *** 185,189 **** done. */ union mhead { ! double mh_align; struct { char mi_alloc; /* ISALLOC or ISFREE */ /* 1 */ --- 185,189 ---- done. */ union mhead { ! bits64_t mh_align; /* 8 */ struct { char mi_alloc; /* ISALLOC or ISFREE */ /* 1 */ *************** *** 201,206 **** /* Access free-list pointer of a block. It is stored at block + sizeof (char *). ! This is not a field in the mhead structure ! because we want sizeof (struct mhead) to describe the overhead for when the block is in use, and we do not want the free-list pointer to count in that. */ --- 201,206 ---- /* Access free-list pointer of a block. It is stored at block + sizeof (char *). ! This is not a field in the minfo structure member of union mhead ! because we want sizeof (union mhead) to describe the overhead for when the block is in use, and we do not want the free-list pointer to count in that. */ *************** *** 491,494 **** --- 491,496 ---- # if defined (HAVE_POSIX_SIGNALS) sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL); + # else + ; /* nothing to do, but need a null statement before the brace */ # endif #endif /* HAVE_BSD_SIGNALS */ diff -aNrc2 bash-2.02.1/lib/posixheaders/memalloc.h bash-2.03/lib/posixheaders/memalloc.h *** bash-2.02.1/lib/posixheaders/memalloc.h Tue Jan 14 16:13:50 1997 --- bash-2.03/lib/posixheaders/memalloc.h Tue Aug 25 11:19:15 1998 *************** *** 35,43 **** #endif /* HAVE_ALLOCA_H && !HAVE_ALLOCA */ ! #if defined (__GNUC__) # undef alloca # define alloca __builtin_alloca ! #else /* !__GNUC__ */ ! # if defined (HAVE_ALLOCA_H) # if defined (IBMESA) # include --- 35,43 ---- #endif /* HAVE_ALLOCA_H && !HAVE_ALLOCA */ ! #if defined (__GNUC__) && !defined (C_ALLOCA) # undef alloca # define alloca __builtin_alloca ! #else /* !__GNUC__ || C_ALLOCA */ ! # if defined (HAVE_ALLOCA_H) && !defined (C_ALLOCA) # if defined (IBMESA) # include *************** *** 45,49 **** # include # endif /* !IBMESA */ ! # else /* !HAVE_ALLOCA_H */ # if defined (__hpux) && defined (__STDC__) && !defined (alloca) extern void *alloca (); --- 45,49 ---- # include # endif /* !IBMESA */ ! # else /* !HAVE_ALLOCA_H || C_ALLOCA */ # if defined (__hpux) && defined (__STDC__) && !defined (alloca) extern void *alloca (); *************** *** 53,58 **** # endif /* !alloca */ # endif /* !__hpux || !__STDC__ && !alloca */ ! # endif /* !HAVE_ALLOCA_H */ ! #endif /* !__GNUC__ */ #endif /* _MEMALLOC_H_ */ --- 53,58 ---- # endif /* !alloca */ # endif /* !__hpux || !__STDC__ && !alloca */ ! # endif /* !HAVE_ALLOCA_H || C_ALLOCA */ ! #endif /* !__GNUC__ || C_ALLOCA */ #endif /* _MEMALLOC_H_ */ diff -aNrc2 bash-2.02.1/lib/posixheaders/posixjmp.h bash-2.03/lib/posixheaders/posixjmp.h *** bash-2.02.1/lib/posixheaders/posixjmp.h Thu Jan 16 13:54:33 1997 --- bash-2.03/lib/posixheaders/posixjmp.h Thu Feb 18 12:34:51 1999 *************** *** 10,17 **** #if defined (HAVE_POSIX_SIGSETJMP) # define procenv_t sigjmp_buf ! # undef setjmp ! # define setjmp(x) sigsetjmp((x), 1) ! # undef longjmp ! # define longjmp(x, n) siglongjmp((x), (n)) #else # define procenv_t jmp_buf --- 10,19 ---- #if defined (HAVE_POSIX_SIGSETJMP) # define procenv_t sigjmp_buf ! # if !defined (__OPENNT) ! # undef setjmp ! # define setjmp(x) sigsetjmp((x), 1) ! # undef longjmp ! # define longjmp(x, n) siglongjmp((x), (n)) ! # endif /* !__OPENNT */ #else # define procenv_t jmp_buf diff -aNrc2 bash-2.02.1/lib/readline/Makefile.in bash-2.03/lib/readline/Makefile.in *** bash-2.02.1/lib/readline/Makefile.in Tue Sep 16 13:11:36 1997 --- bash-2.03/lib/readline/Makefile.in Thu Feb 18 12:12:41 1999 *************** *** 17,25 **** RANLIB = @RANLIB@ AR = @AR@ RM = rm -f CP = cp MV = mv ! SHELL = /bin/sh # Programs to make tags files. --- 17,26 ---- RANLIB = @RANLIB@ AR = @AR@ + ARFLAGS = @ARFLAGS@ RM = rm -f CP = cp MV = mv ! SHELL = @MAKE_SHELL@ # Programs to make tags files. *************** *** 40,43 **** --- 41,45 ---- .c.o: + ${RM} $@ $(CC) -c $(CCFLAGS) $< *************** *** 55,66 **** $(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \ $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \ ! $(srcdir)/shell.c $(srcdir)/tilde.c # The header files for this library. HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \ posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \ ! ansi_stdlib.h tcap.h ! HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o TILDEOBJ = tilde.o OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \ --- 57,68 ---- $(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \ $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \ ! $(srcdir)/shell.c $(srcdir)/tilde.c $(srcdir)/savestring.c # The header files for this library. HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \ posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \ ! ansi_stdlib.h rlstdc.h tcap.h ! HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o savestring.o TILDEOBJ = tilde.o OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \ *************** *** 89,98 **** libreadline.a: $(OBJECTS) $(RM) $@ ! $(AR) cr $@ $(OBJECTS) -test -n "$(RANLIB)" && $(RANLIB) $@ libhistory.a: $(HISTOBJ) xmalloc.o $(RM) $@ ! $(AR) cr $@ $(HISTOBJ) xmalloc.o -test -n "$(RANLIB)" && $(RANLIB) $@ --- 91,100 ---- libreadline.a: $(OBJECTS) $(RM) $@ ! $(AR) $(ARFLAGS) $@ $(OBJECTS) -test -n "$(RANLIB)" && $(RANLIB) $@ libhistory.a: $(HISTOBJ) xmalloc.o $(RM) $@ ! $(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o -test -n "$(RANLIB)" && $(RANLIB) $@ *************** *** 131,202 **** bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h bind.o: readline.h keymaps.h chardefs.h tilde.h ! bind.o: history.h callback.o: rlconf.h callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h ! callback.o: readline.h keymaps.h chardefs.h tilde.h complete.o: ansi_stdlib.h posixdir.h posixstat.h complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h ! complete.o: readline.h keymaps.h chardefs.h tilde.h display.o: ansi_stdlib.h posixstat.h display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h display.o: tcap.h display.o: readline.h keymaps.h chardefs.h tilde.h ! display.o: history.h funmap.o: readline.h keymaps.h chardefs.h tilde.h ! funmap.o: rlconf.h ansi_stdlib.h funmap.o: ${BUILD_DIR}/config.h histexpand.o: ansi_stdlib.h ! histexpand.o: history.h histlib.h histexpand.o: ${BUILD_DIR}/config.h histfile.o: ansi_stdlib.h ! histfile.o: history.h histlib.h histfile.o: ${BUILD_DIR}/config.h history.o: ansi_stdlib.h ! history.o: history.h histlib.h history.o: ${BUILD_DIR}/config.h histsearch.o: ansi_stdlib.h ! histsearch.o: history.h histlib.h histsearch.o: ${BUILD_DIR}/config.h input.o: ansi_stdlib.h input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h ! input.o: readline.h keymaps.h chardefs.h tilde.h isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h isearch.o: readline.h keymaps.h chardefs.h tilde.h ! isearch.o: ansi_stdlib.h history.h keymaps.o: emacs_keymap.c vi_keymap.c keymaps.o: keymaps.h chardefs.h rlconf.h ansi_stdlib.h keymaps.o: readline.h keymaps.h chardefs.h tilde.h ! keymaps.o: ${BUILD_DIR}/config.h kill.o: ansi_stdlib.h kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h kill.o: readline.h keymaps.h chardefs.h tilde.h ! kill.o: history.h macro.o: ansi_stdlib.h macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h macro.o: readline.h keymaps.h chardefs.h tilde.h ! macro.o: history.h nls.o: ansi_stdlib.h nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h parens.o: rlconf.h parens.o: ${BUILD_DIR}/config.h ! parens.o: readline.h keymaps.h chardefs.h tilde.h readline.o: readline.h keymaps.h chardefs.h tilde.h readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h ! readline.o: history.h readline.o: posixstat.h ansi_stdlib.h posixjmp.h rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h rltty.o: rltty.h ! rltty.o: readline.h keymaps.h chardefs.h tilde.h search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h search.o: readline.h keymaps.h chardefs.h tilde.h ! search.o: ansi_stdlib.h history.h shell.o: ${BUILD_DIR}/config.h ansi_stdlib.h signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h signals.o: readline.h keymaps.h chardefs.h tilde.h ! signals.o: history.h terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h terminal.o: tcap.h terminal.o: readline.h keymaps.h chardefs.h tilde.h ! terminal.o: history.h tilde.o: ansi_stdlib.h tilde.o: ${BUILD_DIR}/config.h --- 133,204 ---- bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h bind.o: readline.h keymaps.h chardefs.h tilde.h ! bind.o: history.h rlstdc.h callback.o: rlconf.h callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h ! callback.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h complete.o: ansi_stdlib.h posixdir.h posixstat.h complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h ! complete.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h display.o: ansi_stdlib.h posixstat.h display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h display.o: tcap.h display.o: readline.h keymaps.h chardefs.h tilde.h ! display.o: history.h rlstdc.h funmap.o: readline.h keymaps.h chardefs.h tilde.h ! funmap.o: rlconf.h ansi_stdlib.h rlstdc.h funmap.o: ${BUILD_DIR}/config.h histexpand.o: ansi_stdlib.h ! histexpand.o: history.h histlib.h rlstdc.h histexpand.o: ${BUILD_DIR}/config.h histfile.o: ansi_stdlib.h ! histfile.o: history.h histlib.h rlstdc.h histfile.o: ${BUILD_DIR}/config.h history.o: ansi_stdlib.h ! history.o: history.h histlib.h rlstdc.h history.o: ${BUILD_DIR}/config.h histsearch.o: ansi_stdlib.h ! histsearch.o: history.h histlib.h rlstdc.h histsearch.o: ${BUILD_DIR}/config.h input.o: ansi_stdlib.h input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h ! input.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h isearch.o: readline.h keymaps.h chardefs.h tilde.h ! isearch.o: ansi_stdlib.h history.h rlstdc.h keymaps.o: emacs_keymap.c vi_keymap.c keymaps.o: keymaps.h chardefs.h rlconf.h ansi_stdlib.h keymaps.o: readline.h keymaps.h chardefs.h tilde.h ! keymaps.o: ${BUILD_DIR}/config.h rlstdc.h kill.o: ansi_stdlib.h kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h kill.o: readline.h keymaps.h chardefs.h tilde.h ! kill.o: history.h rlstdc.h macro.o: ansi_stdlib.h macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h macro.o: readline.h keymaps.h chardefs.h tilde.h ! macro.o: history.h rlstdc.h nls.o: ansi_stdlib.h nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h parens.o: rlconf.h parens.o: ${BUILD_DIR}/config.h ! parens.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h readline.o: readline.h keymaps.h chardefs.h tilde.h readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h ! readline.o: history.h rlstdc.h readline.o: posixstat.h ansi_stdlib.h posixjmp.h rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h rltty.o: rltty.h ! rltty.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h search.o: readline.h keymaps.h chardefs.h tilde.h ! search.o: ansi_stdlib.h history.h rlstdc.h shell.o: ${BUILD_DIR}/config.h ansi_stdlib.h signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h signals.o: readline.h keymaps.h chardefs.h tilde.h ! signals.o: history.h rlstdc.h terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h terminal.o: tcap.h terminal.o: readline.h keymaps.h chardefs.h tilde.h ! terminal.o: history.h rlstdc.h tilde.o: ansi_stdlib.h tilde.o: ${BUILD_DIR}/config.h *************** *** 205,215 **** undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h undo.o: readline.h keymaps.h chardefs.h tilde.h ! undo.o: history.h util.o: posixjmp.h ansi_stdlib.h util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h ! util.o: readline.h keymaps.h chardefs.h tilde.h vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h vi_mode.o: readline.h keymaps.h chardefs.h tilde.h ! vi_mode.o: history.h ansi_stdlib.h xmalloc.o: ${BUILD_DIR}/config.h xmalloc.o: ansi_stdlib.h --- 207,217 ---- undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h undo.o: readline.h keymaps.h chardefs.h tilde.h ! undo.o: history.h rlstdc.h util.o: posixjmp.h ansi_stdlib.h util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h ! util.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h vi_mode.o: readline.h keymaps.h chardefs.h tilde.h ! vi_mode.o: history.h ansi_stdlib.h rlstdc.h xmalloc.o: ${BUILD_DIR}/config.h xmalloc.o: ansi_stdlib.h *************** *** 234,237 **** --- 236,240 ---- readline.o: readline.c rltty.o: rltty.c + savestring.o: savestring.c search.o: search.c shell.o: shell.c diff -aNrc2 bash-2.02.1/lib/readline/STANDALONE bash-2.03/lib/readline/STANDALONE *** bash-2.02.1/lib/readline/STANDALONE Tue Aug 16 12:04:06 1994 --- bash-2.03/lib/readline/STANDALONE Fri Jun 5 15:19:20 1998 *************** *** 1,32 **** ! This is a description of C preprocessor defines that readline accepts. ! Most are passed in from the parent `make'; e.g. from the bash source ! directory. ! ! NO_SYS_FILE is not present ! HAVE_UNISTD_H exists ! HAVE_STDLIB_H exists ! HAVE_VARARGS_H exists and is usable ! HAVE_STRING_H exists ! HAVE_ALLOCA_H exists and is needed for alloca() ! HAVE_ALLOCA alloca(3) or a define for it exists ! PRAGMA_ALLOCA use of alloca() requires a #pragma, as in AIX 3.x ! VOID_SIGHANDLER signal handlers are void functions ! HAVE_DIRENT_H exists and is usable ! HAVE_SYS_PTEM_H exists ! HAVE_SYS_PTE_H exists ! HAVE_SYS_STREAM_H exists ! HAVE_SYS_SELECT_H exists ! ! System-specific options: ! ! GWINSZ_IN_SYS_IOCTL need to include for TIOCGWINSZ ! HAVE_GETPW_DECLS the getpw* functions are declared in and cannot ! be redeclared without compiler errors ! HAVE_STRCASECMP the strcasecmp and strncasecmp functions are available ! ! USG Running a variant of System V ! USGr3 Running System V.3 ! XENIX_22 Xenix 2.2 ! Linux Linux ! CRAY running a recent version of Cray UNICOS ! SunOS4 Running SunOS 4.x --- 1,2 ---- ! This is not to be built as a standalone library to be installed in some ! public place; get the full readline distribution instead. diff -aNrc2 bash-2.02.1/lib/readline/bind.c bash-2.03/lib/readline/bind.c *** bash-2.02.1/lib/readline/bind.c Mon Oct 6 13:45:33 1997 --- bash-2.03/lib/readline/bind.c Tue Feb 2 13:26:20 1999 *************** *** 84,87 **** --- 84,88 ---- extern int rl_inhibit_completion; extern char *_rl_comment_begin; + extern unsigned char *_rl_isearch_terminators; extern int rl_explicit_arg; *************** *** 208,218 **** Keymap map; { ! register int i; ! for (i = 0; i < KEYMAP_SIZE; i++) { if (map[i].type == ISFUNC && map[i].function == func) ! map[i].function = (Function *)NULL; } } --- 209,223 ---- Keymap map; { ! register int i, rval; ! for (i = rval = 0; i < KEYMAP_SIZE; i++) { if (map[i].type == ISFUNC && map[i].function == func) ! { ! map[i].function = (Function *)NULL; ! rval = 1; ! } } + return rval; } *************** *** 223,227 **** { Function *func; - register int i; func = rl_named_function (command); --- 228,231 ---- *************** *** 664,668 **** --- 668,676 ---- close (file); + #if 0 if (i < file_size) + #else + if (i < 0) + #endif { free (buffer); *************** *** 728,731 **** --- 736,741 ---- openname = tilde_expand (filename); buffer = _rl_read_file (openname, &file_size); + free (openname); + if (buffer == 0) return (errno); *************** *** 1339,1343 **** --- 1349,1380 ---- _rl_bell_preference = AUDIBLE_BELL; } + else if (_rl_stricmp (name, "isearch-terminators") == 0) + { + /* Isolate the value and translate it into a character string. */ + int beg, end; + char *v; + + v = savestring (value); + FREE (_rl_isearch_terminators); + if (v[0] == '"' || v[0] == '\'') + { + int delim = v[0]; + for (beg = end = 1; v[end] && v[end] != delim; end++) + ; + } + else + { + for (beg = end = 0; whitespace (v[end]) == 0; end++) + ; + } + v[end] = '\0'; + /* The value starts at v + beg. Translate it into a character string. */ + _rl_isearch_terminators = (unsigned char *)xmalloc (2 * strlen (v) + 1); + rl_translate_keyseq (v + beg, _rl_isearch_terminators, &end); + _rl_isearch_terminators[end] = '\0'; + free (v); + } + /* For the time being, unknown variable names are simply ignored. */ return 0; *************** *** 1493,1497 **** { char *keyname; ! int i, c, v; keyname = (char *)xmalloc (8); --- 1530,1534 ---- { char *keyname; ! int i, c; keyname = (char *)xmalloc (8); *************** *** 1898,1901 **** --- 1935,1953 ---- else fprintf (rl_outstream, "keymap is set to `%s'\n", kname ? kname : "none"); + + /* isearch-terminators */ + if (_rl_isearch_terminators) + { + char *disp; + + disp = _rl_untranslate_macro_value (_rl_isearch_terminators); + + if (print_readably) + fprintf (rl_outstream, "set isearch-terminators \"%s\"\n", disp); + else + fprintf (rl_outstream, "isearch-terminators is set to \"%s\"\n", disp); + + free (disp); + } } diff -aNrc2 bash-2.02.1/lib/readline/callback.c bash-2.03/lib/readline/callback.c *** bash-2.02.1/lib/readline/callback.c Thu Feb 5 13:40:46 1998 --- bash-2.03/lib/readline/callback.c Wed Jun 3 13:34:10 1998 *************** *** 37,41 **** #include "readline.h" ! extern void readline_internal_startup (); extern char *readline_internal_teardown (); extern int readline_internal_char (); --- 37,41 ---- #include "readline.h" ! extern void readline_internal_setup (); extern char *readline_internal_teardown (); extern int readline_internal_char (); diff -aNrc2 bash-2.02.1/lib/readline/complete.c bash-2.03/lib/readline/complete.c *** bash-2.02.1/lib/readline/complete.c Thu Jan 29 15:19:46 1998 --- bash-2.03/lib/readline/complete.c Thu Feb 18 12:35:57 1999 *************** *** 86,89 **** --- 86,98 ---- extern int rl_display_fixed; + /* If non-zero, then this is the address of a function to call when + completing a word would normally display the list of possible matches. + This function is called instead of actually doing the display. + It takes three arguments: (char **matches, int num_matches, int max_length) + where MATCHES is the array of strings that matched, NUM_MATCHES is the + number of strings in that array, and MAX_LENGTH is the length of the + longest string in that array. */ + VFunction *rl_completion_display_matches_hook = (VFunction *)NULL; + /* Forward declarations for functions defined and used in this file. */ char *filename_completion_function (); *************** *** 675,678 **** --- 684,688 ---- filename dequoting function. */ temp = (char *)NULL; + if (found_quote && our_func == (Function *)filename_completion_function && rl_filename_dequoting_function) *************** *** 683,687 **** } ! matches = completion_matches (text, our_func); FREE (temp); return matches; --- 693,697 ---- } ! matches = completion_matches (text, (CPFunction *)our_func); FREE (temp); return matches; *************** *** 814,819 **** static int ! postprocess_matches (text, matchesp, matching_filenames) ! char *text; char ***matchesp; int matching_filenames; --- 824,828 ---- static int ! postprocess_matches (matchesp, matching_filenames) char ***matchesp; int matching_filenames; *************** *** 846,850 **** { FREE (matches); - ding (); *matchesp = (char **)0; return 0; --- 855,858 ---- *************** *** 858,862 **** { t = matches[0]; ! compute_lcd_of_matches (matches, i - 1, text); FREE (t); } --- 866,870 ---- { t = matches[0]; ! compute_lcd_of_matches (matches, i - 1, t); FREE (t); } *************** *** 868,931 **** } ! static void ! display_matches (matches) char **matches; { ! int len, count, limit, max, printed_len; int i, j, k, l; char *temp; - /* Move to the last visible line of a possibly-multiple-line command. */ - _rl_move_vert (_rl_vis_botlin); - - /* Handle simple case first. What if there is only one answer? */ - if (matches[1] == 0) - { - temp = printable_part (matches[0]); - crlf (); - print_filename (temp, matches[0]); - crlf (); - #if 0 - rl_on_new_line (); - #else - rl_forced_update_display (); - rl_display_fixed = 1; - #endif - return; - } - - /* There is more than one answer. Find out how many there are, - and find the maximum printed length of a single entry. */ - for (max = 0, i = 1; matches[i]; i++) - { - temp = printable_part (matches[i]); - len = strlen (temp); - - if (len > max) - max = len; - } - - len = i - 1; - - /* If there are many items, then ask the user if she really wants to - see them all. */ - if (len >= rl_completion_query_items) - { - crlf (); - fprintf (rl_outstream, "Display all %d possibilities? (y or n)", len); - fflush (rl_outstream); - if (get_y_or_n () == 0) - { - crlf (); - #if 0 - rl_on_new_line (); - #else - rl_forced_update_display (); - rl_display_fixed = 1; - #endif - return; - } - } - /* How many items of MAX length can we fit in the screen window? */ max += 2; --- 876,892 ---- } ! /* A convenience function for displaying a list of strings in ! columnar format on readline's output stream. MATCHES is the list ! of strings, in argv format, LEN is the number of strings in MATCHES, ! and MAX is the length of the longest string in MATCHES. */ ! void ! rl_display_match_list (matches, len, max) char **matches; + int len, max; { ! int count, limit, printed_len; int i, j, k, l; char *temp; /* How many items of MAX length can we fit in the screen window? */ max += 2; *************** *** 994,1004 **** crlf (); } - #if 0 - rl_on_new_line (); - #else rl_forced_update_display (); rl_display_fixed = 1; - #endif } --- 955,1037 ---- crlf (); } + } + + /* Display MATCHES, a list of matching filenames in argv format. This + handles the simple case -- a single match -- first. If there is more + than one match, we compute the number of strings in the list and the + length of the longest string, which will be needed by the display + function. If the application wants to handle displaying the list of + matches itself, it sets RL_COMPLETION_DISPLAY_MATCHES_HOOK to the + address of a function, and we just call it. If we're handling the + display ourselves, we just call rl_display_match_list. We also check + that the list of matches doesn't exceed the user-settable threshold, + and ask the user if he wants to see the list if there are more matches + than RL_COMPLETION_QUERY_ITEMS. */ + static void + display_matches (matches) + char **matches; + { + int len, max, i; + char *temp; + + /* Move to the last visible line of a possibly-multiple-line command. */ + _rl_move_vert (_rl_vis_botlin); + + /* Handle simple case first. What if there is only one answer? */ + if (matches[1] == 0) + { + temp = printable_part (matches[0]); + crlf (); + print_filename (temp, matches[0]); + crlf (); + + rl_forced_update_display (); + rl_display_fixed = 1; + + return; + } + + /* There is more than one answer. Find out how many there are, + and find the maximum printed length of a single entry. */ + for (max = 0, i = 1; matches[i]; i++) + { + temp = printable_part (matches[i]); + len = strlen (temp); + + if (len > max) + max = len; + } + + len = i - 1; + + /* If the caller has defined a display hook, then call that now. */ + if (rl_completion_display_matches_hook) + { + (*rl_completion_display_matches_hook) (matches, len, max); + return; + } + + /* If there are many items, then ask the user if she really wants to + see them all. */ + if (len >= rl_completion_query_items) + { + crlf (); + fprintf (rl_outstream, "Display all %d possibilities? (y or n)", len); + fflush (rl_outstream); + if (get_y_or_n () == 0) + { + crlf (); + + rl_forced_update_display (); + rl_display_fixed = 1; + + return; + } + } + + rl_display_match_list (matches, len, max); rl_forced_update_display (); rl_display_fixed = 1; } *************** *** 1027,1035 **** if (should_quote) ! #if defined (SHELL) ! should_quote = should_quote && (!qc || !*qc || *qc == '"' || *qc == '\''); ! #else /* !SHELL */ ! should_quote = should_quote && (!qc || !*qc); ! #endif /* !SHELL */ if (should_quote) --- 1060,1065 ---- if (should_quote) ! should_quote = should_quote && (!qc || !*qc || ! (rl_completer_quote_characters && strchr (rl_completer_quote_characters, *qc))); if (should_quote) *************** *** 1169,1172 **** --- 1199,1213 ---- } + static void + free_match_list (matches) + char **matches; + { + register int i; + + for (i = 0; matches[i]; i++) + free (matches[i]); + free (matches); + } + /* Complete the word at or before point. WHAT_TO_DO says what to do with the completion. *************** *** 1211,1214 **** --- 1252,1256 ---- text = rl_copy_text (start, end); matches = gen_completion_matches (text, start, end, our_func, found_quote, quote_char); + free (text); if (matches == 0) *************** *** 1216,1235 **** ding (); FREE (saved_line_buffer); - free (text); return (0); } /* If we are matching filenames, our_func will have been set to filename_completion_function */ i = our_func == (Function *)filename_completion_function; ! if (postprocess_matches (text, &matches, i) == 0) { FREE (saved_line_buffer); ! free (text); return (0); } - free (text); - switch (what_to_do) { --- 1258,1283 ---- ding (); FREE (saved_line_buffer); return (0); } + #if 0 /* If we are matching filenames, our_func will have been set to filename_completion_function */ i = our_func == (Function *)filename_completion_function; ! #else ! /* If we are matching filenames, the attempted completion function will ! have set rl_filename_completion_desired to a non-zero value. The basic ! filename_completion_function does this. */ ! i = rl_filename_completion_desired; ! #endif ! ! if (postprocess_matches (&matches, i) == 0) { + ding (); FREE (saved_line_buffer); ! completion_changed_buffer = 0; return (0); } switch (what_to_do) { *************** *** 1278,1284 **** } ! for (i = 0; matches[i]; i++) ! free (matches[i]); ! free (matches); /* Check to see if the line has changed through all of this manipulation. */ --- 1326,1330 ---- } ! free_match_list (matches); /* Check to see if the line has changed through all of this manipulation. */ *************** *** 1359,1366 **** char * username_completion_function (text, state) - int state; char *text; { ! #if defined (__GO32__) || defined (__WIN32__) return (char *)NULL; #else /* !__GO32__ */ --- 1405,1412 ---- char * username_completion_function (text, state) char *text; + int state; { ! #if defined (__GO32__) || defined (__WIN32__) || defined (__OPENNT) return (char *)NULL; #else /* !__GO32__ */ *************** *** 1416,1421 **** char * filename_completion_function (text, state) - int state; char *text; { static DIR *directory = (DIR *)NULL; --- 1462,1467 ---- char * filename_completion_function (text, state) char *text; + int state; { static DIR *directory = (DIR *)NULL; *************** *** 1575,1579 **** } ! strcpy (temp + dirlen, entry->d_name); /* strcat (temp, entry->d_name); */ } else --- 1621,1625 ---- } ! strcpy (temp + dirlen, entry->d_name); } else *************** *** 1650,1657 **** our_func, found_quote, quote_char); /* If we are matching filenames, our_func will have been set to filename_completion_function */ matching_filenames = our_func == (Function *)filename_completion_function; ! if (matches == 0 || postprocess_matches (orig_text, &matches, matching_filenames) == 0) { ding (); --- 1696,1710 ---- our_func, found_quote, quote_char); + #if 0 /* If we are matching filenames, our_func will have been set to filename_completion_function */ matching_filenames = our_func == (Function *)filename_completion_function; ! #else ! /* If we are matching filenames, the attempted completion function will ! have set rl_filename_completion_desired to a non-zero value. The basic ! filename_completion_function does this. */ ! matching_filenames = rl_filename_completion_desired; ! #endif ! if (matches == 0 || postprocess_matches (&matches, matching_filenames) == 0) { ding (); *************** *** 1687,1691 **** match_list_index += match_list_size; ! if (match_list_index == 0) { ding (); --- 1740,1744 ---- match_list_index += match_list_size; ! if (match_list_index == 0 && match_list_size > 1) { ding (); diff -aNrc2 bash-2.02.1/lib/readline/display.c bash-2.03/lib/readline/display.c *** bash-2.02.1/lib/readline/display.c Tue Jun 30 12:09:32 1998 --- bash-2.03/lib/readline/display.c Thu Dec 17 15:36:30 1998 *************** *** 281,285 **** free (local_prompt_prefix); local_prompt = local_prompt_prefix = (char *)0; ! last_invisible = 0; if (prompt == 0 || *prompt == 0) --- 281,285 ---- free (local_prompt_prefix); local_prompt = local_prompt_prefix = (char *)0; ! last_invisible = visible_length = 0; if (prompt == 0 || *prompt == 0) *************** *** 374,377 **** --- 374,384 ---- if (local_len > 0) { + temp = local_len + out + 2; + if (temp >= line_size) + { + line_size = (temp + 1024) - (temp % 1024); + visible_line = xrealloc (visible_line, line_size); + line = invisible_line = xrealloc (invisible_line, line_size); + } strncpy (line + out, local_prompt, local_len); out += local_len; *************** *** 400,403 **** --- 407,417 ---- pmtlen = strlen (prompt_this_line); + temp = pmtlen + out + 2; + if (temp >= line_size) + { + line_size = (temp + 1024) - (temp % 1024); + visible_line = xrealloc (visible_line, line_size); + line = invisible_line = xrealloc (invisible_line, line_size); + } strncpy (line + out, prompt_this_line, pmtlen); out += pmtlen; *************** *** 408,417 **** #define CHECK_LPOS() \ do { \ ! lpos++; \ ! if (lpos >= screenwidth) \ ! { \ ! inv_lbreaks[++newlines] = out; \ ! lpos = 0; \ ! } \ } while (0) --- 422,431 ---- #define CHECK_LPOS() \ do { \ ! lpos++; \ ! if (lpos >= screenwidth) \ ! { \ ! inv_lbreaks[++newlines] = out; \ ! lpos = 0; \ ! } \ } while (0) *************** *** 482,486 **** --- 496,505 ---- { register int temp, newout; + + #if 0 newout = (out | (int)7) + 1; + #else + newout = out + 8 - lpos % 8; + #endif temp = newout - out; if (lpos + temp >= screenwidth) *************** *** 502,510 **** #endif else if (c == '\n' && _rl_horizontal_scroll_mode == 0 && term_up && *term_up) ! { ! line[out++] = '\0'; /* XXX - sentinel */ ! inv_lbreaks[++newlines] = out; ! lpos = 0; ! } else if (CTRL_CHAR (c) || c == RUBOUT) { --- 521,529 ---- #endif else if (c == '\n' && _rl_horizontal_scroll_mode == 0 && term_up && *term_up) ! { ! line[out++] = '\0'; /* XXX - sentinel */ ! inv_lbreaks[++newlines] = out; ! lpos = 0; ! } else if (CTRL_CHAR (c) || c == RUBOUT) { *************** *** 617,625 **** _rl_move_vert (cursor_linenum); /* If we moved up to the line with the prompt using term_up, ! the physical cursor position on the screen stays the same, ! but the buffer position needs to be adjusted to account ! for invisible characters. */ if (cursor_linenum == 0 && wrap_offset) ! _rl_last_c_pos += wrap_offset; } --- 636,644 ---- _rl_move_vert (cursor_linenum); /* If we moved up to the line with the prompt using term_up, ! the physical cursor position on the screen stays the same, ! but the buffer position needs to be adjusted to account ! for invisible characters. */ if (cursor_linenum == 0 && wrap_offset) ! _rl_last_c_pos += wrap_offset; } *************** *** 674,687 **** nleft = visible_length + wrap_offset; /* Where the new cursor position will be on the screen. This can be ! longer than SCREENWIDTH; if it is, lmargin will be adjusted. */ phys_c_pos = c_pos - (last_lmargin ? last_lmargin : wrap_offset); t = screenwidth / 3; /* If the number of characters had already exceeded the screenwidth, ! last_lmargin will be > 0. */ /* If the number of characters to be displayed is more than the screen ! width, compute the starting offset so that the cursor is about ! two-thirds of the way across the screen. */ if (phys_c_pos > screenwidth - 2) { --- 693,706 ---- nleft = visible_length + wrap_offset; /* Where the new cursor position will be on the screen. This can be ! longer than SCREENWIDTH; if it is, lmargin will be adjusted. */ phys_c_pos = c_pos - (last_lmargin ? last_lmargin : wrap_offset); t = screenwidth / 3; /* If the number of characters had already exceeded the screenwidth, ! last_lmargin will be > 0. */ /* If the number of characters to be displayed is more than the screen ! width, compute the starting offset so that the cursor is about ! two-thirds of the way across the screen. */ if (phys_c_pos > screenwidth - 2) { *************** *** 695,699 **** } else if (ndisp < screenwidth - 2) /* XXX - was -1 */ ! lmargin = 0; else if (phys_c_pos < 1) { --- 714,718 ---- } else if (ndisp < screenwidth - 2) /* XXX - was -1 */ ! lmargin = 0; else if (phys_c_pos < 1) { *************** *** 705,709 **** } else ! lmargin = last_lmargin; /* If the first character on the screen isn't the first character --- 724,728 ---- } else ! lmargin = last_lmargin; /* If the first character on the screen isn't the first character *************** *** 713,722 **** /* If SCREENWIDTH characters starting at LMARGIN do not encompass ! the whole line, indicate that with a special characters at the ! right edge of the screen. If LMARGIN is 0, we need to take the ! wrap offset into account. */ t = lmargin + M_OFFSET (lmargin, wrap_offset) + screenwidth; if (t < out) ! line[t - 1] = '>'; if (!rl_display_fixed || forced_display || lmargin != last_lmargin) --- 732,741 ---- /* If SCREENWIDTH characters starting at LMARGIN do not encompass ! the whole line, indicate that with a special character at the ! right edge of the screen. If LMARGIN is 0, we need to take the ! wrap offset into account. */ t = lmargin + M_OFFSET (lmargin, wrap_offset) + screenwidth; if (t < out) ! line[t - 1] = '>'; if (!rl_display_fixed || forced_display || lmargin != last_lmargin) *************** *** 783,787 **** All are character pointers for the sake of speed. Special cases for ! no differences, as well as for end of line additions must be handeled. Could be made even smarter, but this works well enough */ --- 802,806 ---- All are character pointers for the sake of speed. Special cases for ! no differences, as well as for end of line additions must be handled. Could be made even smarter, but this works well enough */ *************** *** 811,815 **** _rl_last_v_pos++; if (old[0] && new[0]) ! old[0] = new[0]; } --- 830,834 ---- _rl_last_v_pos++; if (old[0] && new[0]) ! old[0] = new[0]; } *************** *** 896,903 **** if (current_line == 0 && !_rl_horizontal_scroll_mode && current_invis_chars != visible_wrap_offset) ! { ! temp = visible_wrap_offset - current_invis_chars; ! lendiff += temp; ! } /* Insert (diff (len (old), len (new)) ch. */ --- 915,919 ---- if (current_line == 0 && !_rl_horizontal_scroll_mode && current_invis_chars != visible_wrap_offset) ! lendiff += visible_wrap_offset - current_invis_chars; /* Insert (diff (len (old), len (new)) ch. */ *************** *** 928,932 **** be "inserted". They can just be placed on the screen. */ /* However, this screws up the rest of this block, which ! assumes you've done the insert because you can. */ _rl_output_some_chars (nfd, lendiff); _rl_last_c_pos += lendiff; --- 944,948 ---- be "inserted". They can just be placed on the screen. */ /* However, this screws up the rest of this block, which ! assumes you've done the insert because you can. */ _rl_output_some_chars (nfd, lendiff); _rl_last_c_pos += lendiff; *************** *** 988,995 **** } lendiff = (oe - old) - (ne - new); ! if (_rl_term_autowrap && current_line < inv_botlin) ! space_to_eol (lendiff); ! else ! _rl_clear_to_eol (lendiff); } } --- 1004,1014 ---- } lendiff = (oe - old) - (ne - new); ! if (lendiff) ! { ! if (_rl_term_autowrap && current_line < inv_botlin) ! space_to_eol (lendiff); ! else ! _rl_clear_to_eol (lendiff); ! } } } *************** *** 1020,1024 **** while (*temp) ! *temp++ = '\0'; } rl_on_new_line (); --- 1039,1043 ---- while (*temp) ! *temp++ = '\0'; } rl_on_new_line (); *************** *** 1081,1085 **** #endif /* HACK_TERMCAP_MOTION */ } ! else if (_rl_last_c_pos != new) _rl_backspace (_rl_last_c_pos - new); _rl_last_c_pos = new; --- 1100,1104 ---- #endif /* HACK_TERMCAP_MOTION */ } ! else if (_rl_last_c_pos > new) _rl_backspace (_rl_last_c_pos - new); _rl_last_c_pos = new; *************** *** 1246,1250 **** void ! _rl_save_prompt () { saved_local_prompt = local_prompt; --- 1265,1269 ---- void ! rl_save_prompt () { saved_local_prompt = local_prompt; *************** *** 1258,1262 **** void ! _rl_restore_prompt () { if (local_prompt) --- 1277,1281 ---- void ! rl_restore_prompt () { if (local_prompt) *************** *** 1278,1282 **** char *pmt; ! _rl_save_prompt (); if (saved_local_prompt == 0) --- 1297,1301 ---- char *pmt; ! rl_save_prompt (); if (saved_local_prompt == 0) *************** *** 1285,1289 **** pmt = xmalloc (len + 2); if (len) ! strcpy (pmt, rl_prompt); pmt[len] = pchar; pmt[len+1] = '\0'; --- 1304,1308 ---- pmt = xmalloc (len + 2); if (len) ! strcpy (pmt, rl_prompt); pmt[len] = pchar; pmt[len+1] = '\0'; *************** *** 1294,1298 **** pmt = xmalloc (len + 2); if (len) ! strcpy (pmt, saved_local_prompt); pmt[len] = pchar; pmt[len+1] = '\0'; --- 1313,1317 ---- pmt = xmalloc (len + 2); if (len) ! strcpy (pmt, saved_local_prompt); pmt[len] = pchar; pmt[len+1] = '\0'; *************** *** 1541,1545 **** _rl_vis_botlin = 0; fflush (rl_outstream); ! rl_restart_output (); } } --- 1560,1573 ---- _rl_vis_botlin = 0; fflush (rl_outstream); ! rl_restart_output (1, 0); } + } + + void + _rl_erase_entire_line () + { + cr (); + _rl_clear_to_eol (0); + cr (); + fflush (rl_outstream); } diff -aNrc2 bash-2.02.1/lib/readline/doc/Makefile bash-2.03/lib/readline/doc/Makefile *** bash-2.02.1/lib/readline/doc/Makefile Wed Jan 29 13:47:09 1997 --- bash-2.03/lib/readline/doc/Makefile Thu Dec 31 12:52:42 1998 *************** *** 1,17 **** # This makefile for Readline library documentation is in -*- text -*- mode. # Emacs likes it that way. RM = rm -f MAKEINFO = makeinfo ! TEXI2DVI = texi2dvi ! TEXI2HTML = texi2html QUIETPS = #set this to -q to shut up dvips DVIPS = dvips -D 300 $(QUIETPS) -o $@ # tricky ! INSTALL_DATA = cp ! infodir = /usr/local/info ! RLSRC = rlman.texinfo rluser.texinfo rltech.texinfo ! HISTSRC = hist.texinfo hsuser.texinfo hstech.texinfo DVIOBJ = readline.dvi history.dvi --- 1,40 ---- + # Generated automatically from Makefile.in by configure. # This makefile for Readline library documentation is in -*- text -*- mode. # Emacs likes it that way. + top_srcdir = . + srcdir = . + VPATH = . + + prefix = /usr/local + infodir = ${prefix}/info + + mandir = ${prefix}/man + man3dir = $(mandir)/man3 + + SHELL = /bin/sh RM = rm -f + TEXINPUTDIR = $(srcdir) + MAKEINFO = makeinfo ! TEXI2DVI = $(srcdir)/texi2dvi ! TEXI2HTML = $(srcdir)/texi2html QUIETPS = #set this to -q to shut up dvips DVIPS = dvips -D 300 $(QUIETPS) -o $@ # tricky ! INSTALL = /usr/bin/install -c ! INSTALL_PROGRAM = ${INSTALL} ! INSTALL_DATA = ${INSTALL} -m 644 ! ! RLSRC = $(srcdir)/rlman.texinfo $(srcdir)/rluser.texinfo \ ! $(srcdir)/rltech.texinfo $(srcdir)/manvers.texinfo ! HISTSRC = $(srcdir)/hist.texinfo $(srcdir)/hsuser.texinfo \ ! $(srcdir)/hstech.texinfo $(srcdir)/manvers.texinfo ! # This should be a program that converts troff to an ascii-readable format ! NROFF = groff -Tascii ! ! # This should be a program that converts troff to postscript ! GROFF = groff DVIOBJ = readline.dvi history.dvi *************** *** 19,39 **** PSOBJ = readline.ps history.ps HTMLOBJ = readline.html history.html ! all: info dvi html ps ! nodvi: info html readline.dvi: $(RLSRC) ! $(TEXI2DVI) rlman.texinfo mv rlman.dvi readline.dvi readline.info: $(RLSRC) ! $(MAKEINFO) --no-split -o $@ rlman.texinfo history.dvi: ${HISTSRC} ! $(TEXI2DVI) hist.texinfo mv hist.dvi history.dvi history.info: ${HISTSRC} ! $(MAKEINFO) --no-split -o $@ hist.texinfo readline.ps: readline.dvi --- 42,74 ---- PSOBJ = readline.ps history.ps HTMLOBJ = readline.html history.html + HTMLTOC = readline_toc.html history_toc.html + TEXTOBJ = readline.0 + + INTERMEDIATE_OBJ = rlman.dvi hist.dvi + + CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ) $(HTMLTOC) $(TEXTOBJ) ! .SUFFIXES: .0 .3 .ps .txt .dvi ! ! .3.0: ! $(RM) $@ ! -${NROFF} -man $< > $@ ! ! all: info dvi html ps #text ! nodvi: info html #text readline.dvi: $(RLSRC) ! TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/rlman.texinfo mv rlman.dvi readline.dvi readline.info: $(RLSRC) ! $(MAKEINFO) --no-split -I $(TEXINPUTDIR) -o $@ $(srcdir)/rlman.texinfo history.dvi: ${HISTSRC} ! TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/hist.texinfo mv hist.dvi history.dvi history.info: ${HISTSRC} ! $(MAKEINFO) --no-split -I $(TEXINPUTDIR) -o $@ $(srcdir)/hist.texinfo readline.ps: readline.dvi *************** *** 46,59 **** readline.html: ${RLSRC} ! $(TEXI2HTML) rlman.texinfo ! sed -e 's:rlman.html:readline.html:' -e 's:rlman_toc.html:readline_toc.html:' rlman.html > readline.html ! sed -e 's:rlman.html:readline.html:' -e 's:rlman_toc.html:readline_toc.html:' rlman_toc.html > readline_toc.html ! $(RM) rlman.html rlman_toc.html history.html: ${HISTSRC} ! $(TEXI2HTML) hist.texinfo ! sed -e 's:hist.html:history.html:' -e 's:hist_toc.html:history_toc.html:' hist.html > history.html ! sed -e 's:hist.html:history.html:' -e 's:hist_toc.html:history_toc.html:' hist_toc.html > history_toc.html ! $(RM) hist.html hist_toc.html info: $(INFOOBJ) --- 81,92 ---- readline.html: ${RLSRC} ! $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/rlman.texinfo ! sed -e 's:rlman.html:readline.html:' rlman.html > readline.html ! $(RM) rlman.html history.html: ${HISTSRC} ! $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/hist.texinfo ! sed -e 's:hist.html:history.html:' hist.html > history.html ! $(RM) hist.html info: $(INFOOBJ) *************** *** 61,64 **** --- 94,100 ---- ps: $(PSOBJ) html: $(HTMLOBJ) + text: $(TEXTOBJ) + + readline.0: readline.3 clean: *************** *** 67,76 **** distclean: clean mostlyclean: clean maintainer-clean: clean ! $(RM) *.dvi *.info *.info-* *.ps *.html ! ! install: info ! ${INSTALL_DATA} readline.info $(infodir)/readline.info ! ${INSTALL_DATA} history.info $(infodir)/history.info --- 103,139 ---- distclean: clean + $(RM) $(CREATED_DOCS) + $(RM) $(INTERMEDIATE_OBJ) + $(RM) Makefile + mostlyclean: clean maintainer-clean: clean ! $(RM) $(CREATED_DOCS) ! $(RM) $(INTERMEDIATE_OBJ) ! $(RM) Makefile ! ! installdirs: $(top_srcdir)/support/mkdirs ! -$(SHELL) $(top_srcdir)/support/mkdirs $(infodir) $(man3dir) ! ! install: installdirs ! if test -f readline.info; then \ ! ${INSTALL_DATA} readline.info $(infodir)/readline.info; \ ! else \ ! ${INSTALL_DATA} $(srcdir)/readline.info $(infodir)/readline.info; \ ! fi ! if test -f history.info; then \ ! ${INSTALL_DATA} history.info $(infodir)/history.info; \ ! else \ ! ${INSTALL_DATA} $(srcdir)/history.info $(infodir)/history.info; \ ! fi ! if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ ! install-info --dir-file=$(infodir)/dir $(infodir)/readline.info ; \ ! install-info --dir-file=$(infodir)/dir $(infodir)/history.info ; \ ! else true; fi ! -${INSTALL_DATA} $(srcdir)/readline.3 $(man3dir)/readline.3 ! ! uninstall: ! $(RM) $(infodir)/readline.info ! $(RM) $(infodir)/history.info ! $(RM) $(man3dir)/readline.3 diff -aNrc2 bash-2.02.1/lib/readline/doc/hist.texinfo bash-2.03/lib/readline/doc/hist.texinfo *** bash-2.02.1/lib/readline/doc/hist.texinfo Thu Apr 2 14:38:53 1998 --- bash-2.03/lib/readline/doc/hist.texinfo Thu Dec 31 12:04:50 1998 *************** *** 7,19 **** @setchapternewpage odd ! @ignore ! last change: Thu Apr 2 14:38:22 EST 1998 ! @end ignore ! ! @set EDITION 2.2 ! @set VERSION 2.2 ! @set UPDATED 2 April 1998 ! @set UPDATE-MONTH April 1998 @dircategory Libraries @direntry --- 7,13 ---- @setchapternewpage odd ! @include manvers.texinfo + @ifinfo @dircategory Libraries @direntry *************** *** 21,30 **** @end direntry - @ifinfo This document describes the GNU History library, a programming tool that provides a consistent user interface for recalling lines of previously typed input. ! Copyright (C) 1988, 1991, 1993, 1995, 1996, 1998 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of --- 15,23 ---- @end direntry This document describes the GNU History library, a programming tool that provides a consistent user interface for recalling lines of previously typed input. ! Copyright (C) 1988-1999 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of *************** *** 47,51 **** into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved ! by the Foundation. @end ifinfo --- 40,44 ---- into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved ! by the Free Software Foundation. @end ifinfo *************** *** 78,85 **** into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved ! by the Foundation. @vskip 0pt plus 1filll ! Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc. @end titlepage --- 71,78 ---- into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved ! by the Free Software Foundation. @vskip 0pt plus 1filll ! Copyright @copyright{} 1988-1999 Free Software Foundation, Inc. @end titlepage diff -aNrc2 bash-2.02.1/lib/readline/doc/manvers.texinfo bash-2.03/lib/readline/doc/manvers.texinfo *** bash-2.02.1/lib/readline/doc/manvers.texinfo Wed Dec 31 19:00:00 1969 --- bash-2.03/lib/readline/doc/manvers.texinfo Thu Dec 31 10:50:36 1998 *************** *** 0 **** --- 1,6 ---- + @set EDITION 4.0 + @set VERSION 4.0 + @set UPDATED 31 December 1998 + @set UPDATE-MONTH December 1998 + + @set LASTCHANGE Thu Dec 31 10:17:05 EST 1998 diff -aNrc2 bash-2.02.1/lib/readline/doc/rlman.texinfo bash-2.03/lib/readline/doc/rlman.texinfo *** bash-2.02.1/lib/readline/doc/rlman.texinfo Thu Apr 2 14:39:18 1998 --- bash-2.03/lib/readline/doc/rlman.texinfo Thu Dec 31 12:05:01 1998 *************** *** 7,19 **** @setchapternewpage odd ! @ignore ! last change: Thu Apr 2 14:39:03 EST 1998 ! @end ignore ! ! @set EDITION 2.2 ! @set VERSION 2.2 ! @set UPDATED 2 April 1998 ! @set UPDATE-MONTH April 1998 @dircategory Libraries @direntry --- 7,13 ---- @setchapternewpage odd ! @include manvers.texinfo + @ifinfo @dircategory Libraries @direntry *************** *** 21,30 **** @end direntry - @ifinfo This document describes the GNU Readline Library, a utility which aids in the consistency of user interface across discrete programs that need to provide a command line interface. ! Copyright (C) 1988, 1991, 1993, 1996, 1998 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of --- 15,23 ---- @end direntry This document describes the GNU Readline Library, a utility which aids in the consistency of user interface across discrete programs that need to provide a command line interface. ! Copyright (C) 1988-1999 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of *************** *** 47,51 **** into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved ! by the Foundation. @end ifinfo --- 40,44 ---- into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved ! by the Free Software Foundation. @end ifinfo *************** *** 78,85 **** into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved ! by the Foundation. @vskip 0pt plus 1filll ! Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc. @end titlepage --- 71,78 ---- into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved ! by the Free Software Foundation. @vskip 0pt plus 1filll ! Copyright @copyright{} 1988-1999 Free Software Foundation, Inc. @end titlepage diff -aNrc2 bash-2.02.1/lib/readline/doc/rltech.texinfo bash-2.03/lib/readline/doc/rltech.texinfo *** bash-2.02.1/lib/readline/doc/rltech.texinfo Wed Feb 4 14:43:56 1998 --- bash-2.03/lib/readline/doc/rltech.texinfo Thu Dec 17 15:49:39 1998 *************** *** 9,13 **** to provide a command line interface. ! Copyright (C) 1988, 1994, 1996 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of --- 9,13 ---- to provide a command line interface. ! Copyright (C) 1988, 1994, 1996, 1998, 1999 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of *************** *** 48,52 **** functions. * Readline Convenience Functions:: Functions which Readline supplies to ! aid in writing your own * Custom Completers:: Supplanting or supplementing Readline's completion functions. --- 48,54 ---- functions. * Readline Convenience Functions:: Functions which Readline supplies to ! aid in writing your own custom ! functions. ! * Readline Signal Handling:: How Readline behaves when it receives signals. * Custom Completers:: Supplanting or supplementing Readline's completion functions. *************** *** 269,272 **** --- 271,281 ---- @end deftypevar + @deftypevar int rl_erase_empty_line + Setting this to a non-zero value causes Readline to completely erase + the current line, including any prompt, any time a newline is typed as + the only character on an otherwise-empty line. The cursor is moved to + the beginning of the newly-blank line. + @end deftypevar + @deftypevar {char *} rl_prompt The prompt Readline uses. This is set from the argument to *************** *** 301,304 **** --- 310,319 ---- @end deftypevar + @deftypevar {Function *} rl_pre_input_hook + If non-zero, this is the address of a function to call after + the first prompt has been printed and just before @code{readline} + starts reading input characters. + @end deftypevar + @deftypevar {Function *} rl_event_hook If non-zero, this is the address of a function to call periodically *************** *** 620,623 **** --- 635,648 ---- @end deftypefun + @deftypefun void rl_save_prompt () + Save the local Readline prompt display state in preparation for + displaying a new message in the message area with @code{rl_message}. + @end deftypefun + + @deftypefun void rl_restore_prompt () + Restore the local Readline prompt display state saved by the most + recent call to @code{rl_save_prompt}. + @end deftypefun + @node Modifying Text @subsection Modifying Text *************** *** 690,693 **** --- 715,728 ---- @end deftypefun + @deftypefun void rl_display_match_list (char **matches, int len, int max) + A convenience function for displaying a list of strings in + columnar format on Readline's output stream. @code{matches} is the list + of strings, in argv format, such as a list of completion matches. + @code{len} is the number of strings in @code{matches}, and @code{max} + is the length of the longest string in @code{matches}. This function uses + the setting of @code{print-completions-horizontally} to select how the + matches are displayed (@pxref{Readline Init File Syntax}). + @end deftypefun + The following are implemented as macros, defined in @code{chartypes.h}. *************** *** 815,818 **** --- 850,963 ---- @end example + @node Readline Signal Handling + @section Readline Signal Handling + + Signals are asynchronous events sent to a process by the Unix kernel, + sometimes on behalf of another process. They are intended to indicate + exceptional events, like a user pressing the interrupt key on his + terminal, or a network connection being broken. There is a class of + signals that can be sent to the process currently reading input from + the keyboard. Since Readline changes the terminal attributes when it + is called, it needs to perform special processing when a signal is + received to restore the terminal to a sane state, or provide application + writers with functions to do so manually. + + Readline contains an internal signal handler that is installed for a + number of signals (@code{SIGINT}, @code{SIGQUIT}, @code{SIGTERM}, + @code{SIGALRM}, @code{SIGTSTP}, @code{SIGTTIN}, and @code{SIGTTOU}). + When one of these signals is received, the signal handler + will reset the terminal attributes to those that were in effect before + @code{readline ()} was called, reset the signal handling to what it was + before @code{readline ()} was called, and resend the signal to the calling + application. + If and when the calling application's signal handler returns, Readline + will reinitialize the terminal and continue to accept input. + When a @code{SIGINT} is received, the Readline signal handler performs + some additional work, which will cause any partially-entered line to be + aborted (see the description of @code{rl_free_line_state ()}). + + There is an additional Readline signal handler, for @code{SIGWINCH}, which + the kernel sends to a process whenever the terminal's size changes (for + example, if a user resizes an @code{xterm}). The Readline @code{SIGWINCH} + handler updates Readline's internal screen size state, and then calls any + @code{SIGWINCH} signal handler the calling application has installed. + Readline calls the application's @code{SIGWINCH} signal handler without + resetting the terminal to its original state. If the application's signal + handler does more than update its idea of the terminal size and return (for + example, a @code{longjmp} back to a main processing loop), it @emph{must} + call @code{rl_cleanup_after_signal ()} (described below), to restore the + terminal state. + + Readline provides two variables that allow application writers to + control whether or not it will catch certain signals and act on them + when they are received. It is important that applications change the + values of these variables only when calling @code{readline ()}, not in + a signal handler, so Readline's internal signal state is not corrupted. + + @deftypevar int rl_catch_signals + If this variable is non-zero, Readline will install signal handlers for + @code{SIGINT}, @code{SIGQUIT}, @code{SIGTERM}, @code{SIGALRM}, + @code{SIGTSTP}, @code{SIGTTIN}, and @code{SIGTTOU}. + + The default value of @code{rl_catch_signals} is 1. + @end deftypevar + + @deftypevar int rl_catch_sigwinch + If this variable is non-zero, Readline will install a signal handler for + @code{SIGWINCH}. + + The default value of @code{rl_catch_sigwinch} is 1. + @end deftypevar + + If an application does not wish to have Readline catch any signals, or + to handle signals other than those Readline catches (@code{SIGHUP}, + for example), + Readline provides convenience functions to do the necessary terminal + and internal state cleanup upon receipt of a signal. + + @deftypefun void rl_cleanup_after_signal (void) + This function will reset the state of the terminal to what it was before + @code{readline ()} was called, and remove the Readline signal handlers for + all signals, depending on the values of @code{rl_catch_signals} and + @code{rl_catch_sigwinch}. + @end deftypefun + + @deftypefun void rl_free_line_state (void) + This will free any partial state associated with the current input line + (undo information, any partial history entry, any partially-entered + keyboard macro, and any partially-entered numeric argument). This + should be called before @code{rl_cleanup_after_signal ()}. The + Readline signal handler for @code{SIGINT} calls this to abort the + current input line. + @end deftypefun + + @deftypefun void rl_reset_after_signal (void) + This will reinitialize the terminal and reinstall any Readline signal + handlers, depending on the values of @code{rl_catch_signals} and + @code{rl_catch_sigwinch}. + @end deftypefun + + If an application does not wish Readline to catch @code{SIGWINCH}, it may + call @code{rl_resize_terminal ()} to force Readline to update its idea of + the terminal size when a @code{SIGWINCH} is received. + + @deftypefun void rl_resize_terminal (void) + Update Readline's internal screen size. + @end deftypefun + + The following functions install and remove Readline's signal handlers. + + @deftypefun int rl_set_signals (void) + Install Readline's signal handler for @code{SIGINT}, @code{SIGQUIT}, + @code{SIGTERM}, @code{SIGALRM}, @code{SIGTSTP}, @code{SIGTTIN}, + @code{SIGTTOU}, and @code{SIGWINCH}, depending on the values of + @code{rl_catch_signals} and @code{rl_catch_sigwinch}. + @end deftypefun + + @deftypefun int rl_clear_signals (void) + Remove all of the Readline signal handlers installed by + @code{rl_set_signals ()}. + @end deftypefun + @node Custom Completers @section Custom Completers *************** *** 1107,1110 **** --- 1252,1269 ---- string (the current directory name) as an argument. It could be used to expand symbolic links or shell variables in pathnames. + @end deftypevar + + @deftypevar {VFunction *} rl_completion_display_matches_hook + If non-zero, then this is the address of a function to call when + completing a word would normally display the list of possible matches. + This function is called in lieu of Readline displaying the list. + It takes three arguments: + (@code{char **}@var{matches}, @code{int} @var{num_matches}, @code{int} @var{max_length}) + where @var{matches} is the array of matching strings, + @var{num_matches} is the number of strings in that array, and + @var{max_length} is the length of the longest string in that array. + Readline provides a convenience function, @code{rl_display_match_list}, + that takes care of doing the display to Readline's output stream. That + function may be called from this hook. @end deftypevar diff -aNrc2 bash-2.02.1/lib/readline/doc/rluser.texinfo bash-2.03/lib/readline/doc/rluser.texinfo *** bash-2.02.1/lib/readline/doc/rluser.texinfo Wed Apr 1 12:26:01 1998 --- bash-2.03/lib/readline/doc/rluser.texinfo Thu Dec 31 12:34:48 1998 *************** *** 98,102 **** * Readline Arguments:: Giving numeric arguments to commands. * Searching:: Searching through previous lines. ! @end menu @node Readline Bare Essentials --- 98,102 ---- * Readline Arguments:: Giving numeric arguments to commands. * Searching:: Searching through previous lines. ! @end menu @node Readline Bare Essentials *************** *** 253,258 **** An incremental search requires only as many characters as needed to find the desired history entry. ! The @key{ESC} character is used to terminate an incremental search. ! @key{C-j} will also terminate the search. @key{C-g} will abort an incremental search and restore the original line. When the search is terminated, the history entry containing the --- 253,260 ---- An incremental search requires only as many characters as needed to find the desired history entry. ! The characters present in the value of the @var{isearch-terminators} variable ! are used to terminate an incremental search. ! If that variable has not been assigned a value, the @key{ESC} and ! @key{C-J} characters will terminate an incremental search. @key{C-g} will abort an incremental search and restore the original line. When the search is terminated, the history entry containing the *************** *** 397,400 **** --- 399,418 ---- this variable is set to @samp{off}. + @item input-meta + @vindex input-meta + @vindex meta-flag + If set to @samp{on}, Readline will enable eight-bit input (it + will not strip the eighth bit from the characters it reads), + regardless of what the terminal claims it can support. The + default value is @samp{off}. The name @code{meta-flag} is a + synonym for this variable. + + @item isearch-terminators + @vindex isearch-terminators + The string of characters that should terminate an incremental search without + subsequently executing the character as a command (@pxref{Searching}). + If this variable has not been given a value, the characters @key{ESC} and + @key{C-J} will terminate an incremental search. + @item keymap @vindex keymap *************** *** 423,435 **** This variable is @samp{off} by default. - @item input-meta - @vindex input-meta - @vindex meta-flag - If set to @samp{on}, Readline will enable eight-bit input (it - will not strip the eighth bit from the characters it reads), - regardless of what the terminal claims it can support. The - default value is @samp{off}. The name @code{meta-flag} is a - synonym for this variable. - @item output-meta @vindex output-meta --- 441,444 ---- *************** *** 877,880 **** --- 886,894 ---- to kill the characters instead of deleting them. + @item forward-backward-delete-char () + Delete the character under the cursor, unless the cursor is at the + end of the line, in which case the character behind the cursor is + deleted. By default, this is not bound to a key. + @item quoted-insert (C-q, C-v) Add the next character typed to the line verbatim. This is *************** *** 1040,1043 **** --- 1054,1064 ---- by default. + @item delete-char-or-list () + Deletes the character under the cursor if not at the beginning or + end of the line (like @code{delete-char}). + If at the end of the line, behaves identically to + @code{possible-completions}. + This command is unbound by default. + @ifset BashFeatures @item complete-filename (M-/) *************** *** 1142,1146 **** --- 1163,1172 ---- command enough times to get back to the beginning. + @ifset BashFeatures + @item tilde-expand (M-&) + @end ifset + @ifclear BashFeatures @item tilde-expand (M-~) + @end ifclear Perform tilde expansion on the current word. diff -aNrc2 bash-2.02.1/lib/readline/examples/rl.c bash-2.03/lib/readline/examples/rl.c *** bash-2.02.1/lib/readline/examples/rl.c Wed Jan 29 11:54:31 1997 --- bash-2.03/lib/readline/examples/rl.c Wed Jun 3 13:38:31 1998 *************** *** 13,17 **** #if defined (HAVE_CONFIG_H) ! #include #endif --- 13,17 ---- #if defined (HAVE_CONFIG_H) ! # include #endif *************** *** 25,29 **** --- 25,31 ---- extern char *optarg; + #if !defined (strchr) && !defined (__STDC__) extern char *strrchr(); + #endif static char *progname; *************** *** 41,44 **** --- 43,47 ---- } + static void usage() { *************** *** 53,57 **** char *temp, *prompt; struct stat sb; ! int done, opt, fd; FILE *ifp; --- 56,60 ---- char *temp, *prompt; struct stat sb; ! int opt, fd; FILE *ifp; diff -aNrc2 bash-2.02.1/lib/readline/funmap.c bash-2.03/lib/readline/funmap.c *** bash-2.02.1/lib/readline/funmap.c Mon Sep 8 16:02:33 1997 --- bash-2.03/lib/readline/funmap.c Thu Dec 31 10:11:50 1998 *************** *** 72,75 **** --- 72,76 ---- { "copy-region-as-kill", rl_copy_region_to_kill }, { "delete-char", rl_delete }, + { "delete-char-or-list", rl_delete_or_show_completions }, { "delete-horizontal-space", rl_delete_horizontal_space }, { "digit-argument", rl_digit_argument }, *************** *** 84,87 **** --- 85,89 ---- { "end-of-line", rl_end_of_line }, { "exchange-point-and-mark", rl_exchange_point_and_mark }, + { "forward-backward-delete-char", rl_rubout_or_delete }, { "forward-char", rl_forward }, { "forward-search-history", rl_forward_search_history }, diff -aNrc2 bash-2.02.1/lib/readline/histexpand.c bash-2.03/lib/readline/histexpand.c *** bash-2.02.1/lib/readline/histexpand.c Thu Nov 6 15:44:45 1997 --- bash-2.03/lib/readline/histexpand.c Tue Jan 12 11:31:39 1999 *************** *** 366,369 **** --- 366,373 ---- elen = 29; break; + case NO_PREV_SUBST: + emsg = "no previous substitution"; + elen = 24; + break; default: emsg = "unknown expansion error"; *************** *** 655,667 **** } - /* If there is no lhs, the substitution can't succeed. */ - if (subst_lhs_len == 0) - { - *ret_string = hist_error (string, starting_index, i, SUBST_FAILED); - free (result); - free (temp); - return -1; - } - FREE (subst_rhs); subst_rhs = get_subst_pattern (string, &i, delimiter, 1, &subst_rhs_len); --- 659,662 ---- *************** *** 674,677 **** --- 669,681 ---- else i += 2; + + /* If there is no lhs, the substitution can't succeed. */ + if (subst_lhs_len == 0) + { + *ret_string = hist_error (string, starting_index, i, NO_PREV_SUBST); + free (result); + free (temp); + return -1; + } l_temp = strlen (temp); diff -aNrc2 bash-2.02.1/lib/readline/histfile.c bash-2.03/lib/readline/histfile.c *** bash-2.02.1/lib/readline/histfile.c Mon Oct 6 13:45:12 1997 --- bash-2.03/lib/readline/histfile.c Tue Sep 15 13:01:56 1998 *************** *** 156,160 **** --- 156,164 ---- buffer = xmalloc (file_size + 1); + #if 0 if (read (file, buffer, file_size) != file_size) + #else + if (read (file, buffer, file_size) < 0) + #endif { error_and_exit: *************** *** 218,222 **** history_truncate_file (fname, lines) char *fname; ! register int lines; { register int i; --- 222,226 ---- history_truncate_file (fname, lines) char *fname; ! int lines; { register int i; *************** *** 277,280 **** --- 281,290 ---- { write (file, buffer + i, file_size - i); + + #if defined (__BEOS__) + /* BeOS ignores O_TRUNC. */ + ftruncate (file, file_size - i); + #endif + close (file); } diff -aNrc2 bash-2.02.1/lib/readline/histlib.h bash-2.03/lib/readline/histlib.h *** bash-2.02.1/lib/readline/histlib.h Thu Nov 21 08:54:24 1996 --- bash-2.03/lib/readline/histlib.h Tue Jan 12 11:15:53 1999 *************** *** 70,73 **** --- 70,74 ---- #define SUBST_FAILED 2 #define BAD_MODIFIER 3 + #define NO_PREV_SUBST 4 /* Possible definitions for history starting point specification. */ diff -aNrc2 bash-2.02.1/lib/readline/history.c bash-2.03/lib/readline/history.c *** bash-2.02.1/lib/readline/history.c Fri Jul 18 17:05:41 1997 --- bash-2.03/lib/readline/history.c Fri Jun 5 16:07:42 1998 *************** *** 279,283 **** int which; char *line; ! char *data; { HIST_ENTRY *temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY)); --- 279,283 ---- int which; char *line; ! histdata_t data; { HIST_ENTRY *temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY)); diff -aNrc2 bash-2.02.1/lib/readline/history.h bash-2.03/lib/readline/history.h *** bash-2.02.1/lib/readline/history.h Wed Mar 26 11:57:22 1997 --- bash-2.03/lib/readline/history.h Fri Jun 5 16:24:45 1998 *************** *** 23,26 **** --- 23,36 ---- #define _HISTORY_H_ + #ifdef __cplusplus + extern "C" { + #endif + + #if defined READLINE_LIBRARY + # include "rlstdc.h" + #else + # include + #endif + #if !defined (_FUNCTION_DEF) # define _FUNCTION_DEF *************** *** 31,38 **** #endif /* The structure used to store a history entry. */ typedef struct _hist_entry { char *line; ! char *data; } HIST_ENTRY; --- 41,54 ---- #endif + #ifdef __STDC__ + typedef void *histdata_t; + #else + typedef char *histdata_t; + #endif + /* The structure used to store a history entry. */ typedef struct _hist_entry { char *line; ! histdata_t data; } HIST_ENTRY; *************** *** 53,63 **** /* Begin a session in which the history functions might be used. This just initializes the interactive variables. */ ! extern void using_history (); /* Return the current HISTORY_STATE of the history. */ ! extern HISTORY_STATE *history_get_history_state (); /* Set the state of the current history array to STATE. */ ! extern void history_set_history_state (); /* Manage the history list. */ --- 69,79 ---- /* Begin a session in which the history functions might be used. This just initializes the interactive variables. */ ! extern void using_history __P((void)); /* Return the current HISTORY_STATE of the history. */ ! extern HISTORY_STATE *history_get_history_state __P((void)); /* Set the state of the current history array to STATE. */ ! extern void history_set_history_state __P((HISTORY_STATE *)); /* Manage the history list. */ *************** *** 65,93 **** /* Place STRING at the end of the history list. The associated data field (if any) is set to NULL. */ ! extern void add_history (); /* A reasonably useless function, only here for completeness. WHICH is the magic number that tells us which element to delete. The elements are numbered from 0. */ ! extern HIST_ENTRY *remove_history (); /* Make the history entry at WHICH have LINE and DATA. This returns the old entry so you can dispose of the data. In the case of an invalid WHICH, a NULL pointer is returned. */ ! extern HIST_ENTRY *replace_history_entry (); /* Clear the history list and start over. */ ! extern void clear_history (); /* Stifle the history list, remembering only MAX number of entries. */ ! extern void stifle_history (); /* Stop stifling the history. This returns the previous amount the history was stifled by. The value is positive if the history was stifled, negative if it wasn't. */ ! extern int unstifle_history (); /* Return 1 if the history is stifled, 0 if it is not. */ ! extern int history_is_stifled (); /* Information about the history list. */ --- 81,109 ---- /* Place STRING at the end of the history list. The associated data field (if any) is set to NULL. */ ! extern void add_history __P((char *)); /* A reasonably useless function, only here for completeness. WHICH is the magic number that tells us which element to delete. The elements are numbered from 0. */ ! extern HIST_ENTRY *remove_history __P((int)); /* Make the history entry at WHICH have LINE and DATA. This returns the old entry so you can dispose of the data. In the case of an invalid WHICH, a NULL pointer is returned. */ ! extern HIST_ENTRY *replace_history_entry __P((int, char *, histdata_t)); /* Clear the history list and start over. */ ! extern void clear_history __P((void)); /* Stifle the history list, remembering only MAX number of entries. */ ! extern void stifle_history __P((int)); /* Stop stifling the history. This returns the previous amount the history was stifled by. The value is positive if the history was stifled, negative if it wasn't. */ ! extern int unstifle_history __P((void)); /* Return 1 if the history is stifled, 0 if it is not. */ ! extern int history_is_stifled __P((void)); /* Information about the history list. */ *************** *** 96,131 **** history. Element 0 of this list is the beginning of time. If there is no history, return NULL. */ ! extern HIST_ENTRY **history_list (); /* Returns the number which says what history element we are now looking at. */ ! extern int where_history (); /* Return the history entry at the current position, as determined by history_offset. If there is no entry there, return a NULL pointer. */ ! HIST_ENTRY *current_history (); /* Return the history entry which is logically at OFFSET in the history array. OFFSET is relative to history_base. */ ! extern HIST_ENTRY *history_get (); /* Return the number of bytes that the primary history entries are using. This just adds up the lengths of the_history->lines. */ ! extern int history_total_bytes (); /* Moving around the history list. */ /* Set the position in the history list to POS. */ ! int history_set_pos (); /* Back up history_offset to the previous history entry, and return a pointer to that entry. If there is no previous entry, return a NULL pointer. */ ! extern HIST_ENTRY *previous_history (); /* Move history_offset forward to the next item in the input_history, and return the a pointer to that entry. If there is no next entry, return a NULL pointer. */ ! extern HIST_ENTRY *next_history (); /* Searching the history list. */ --- 112,147 ---- history. Element 0 of this list is the beginning of time. If there is no history, return NULL. */ ! extern HIST_ENTRY **history_list __P((void)); /* Returns the number which says what history element we are now looking at. */ ! extern int where_history __P((void)); /* Return the history entry at the current position, as determined by history_offset. If there is no entry there, return a NULL pointer. */ ! HIST_ENTRY *current_history __P((void)); /* Return the history entry which is logically at OFFSET in the history array. OFFSET is relative to history_base. */ ! extern HIST_ENTRY *history_get __P((int)); /* Return the number of bytes that the primary history entries are using. This just adds up the lengths of the_history->lines. */ ! extern int history_total_bytes __P((void)); /* Moving around the history list. */ /* Set the position in the history list to POS. */ ! int history_set_pos __P((int)); /* Back up history_offset to the previous history entry, and return a pointer to that entry. If there is no previous entry, return a NULL pointer. */ ! extern HIST_ENTRY *previous_history __P((void)); /* Move history_offset forward to the next item in the input_history, and return the a pointer to that entry. If there is no next entry, return a NULL pointer. */ ! extern HIST_ENTRY *next_history __P((void)); /* Searching the history list. */ *************** *** 137,145 **** is the offset in the line of that history entry that the string was found in. Otherwise, nothing is changed, and a -1 is returned. */ ! extern int history_search (); /* Search the history for STRING, starting at history_offset. ! The search is anchored: matching lines must begin with string. */ ! extern int history_search_prefix (); /* Search for STRING in the history list, starting at POS, an --- 153,162 ---- is the offset in the line of that history entry that the string was found in. Otherwise, nothing is changed, and a -1 is returned. */ ! extern int history_search __P((char *, int)); /* Search the history for STRING, starting at history_offset. ! The search is anchored: matching lines must begin with string. ! DIRECTION is as in history_search(). */ ! extern int history_search_prefix __P((char *, int)); /* Search for STRING in the history list, starting at POS, an *************** *** 148,152 **** Returns the absolute index of the history element where STRING was found, or -1 otherwise. */ ! extern int history_search_pos (); /* Managing the history file. */ --- 165,169 ---- Returns the absolute index of the history element where STRING was found, or -1 otherwise. */ ! extern int history_search_pos __P((char *, int, int)); /* Managing the history file. */ *************** *** 155,159 **** If FILENAME is NULL, then read from ~/.history. Returns 0 if successful, or errno if not. */ ! extern int read_history (); /* Read a range of lines from FILENAME, adding them to the history list. --- 172,176 ---- If FILENAME is NULL, then read from ~/.history. Returns 0 if successful, or errno if not. */ ! extern int read_history __P((char *)); /* Read a range of lines from FILENAME, adding them to the history list. *************** *** 162,178 **** until the end of the file. If FILENAME is NULL, then read from ~/.history. Returns 0 if successful, or errno if not. */ ! extern int read_history_range (); /* Write the current history to FILENAME. If FILENAME is NULL, then write the history list to ~/.history. Values returned are as in read_history (). */ ! extern int write_history (); /* Append NELEMENT entries to FILENAME. The entries appended are from the end of the list minus NELEMENTs up to the end of the list. */ ! int append_history (); /* Truncate the history file, leaving only the last NLINES lines. */ ! extern int history_truncate_file (); /* History expansion. */ --- 179,195 ---- until the end of the file. If FILENAME is NULL, then read from ~/.history. Returns 0 if successful, or errno if not. */ ! extern int read_history_range __P((char *, int, int)); /* Write the current history to FILENAME. If FILENAME is NULL, then write the history list to ~/.history. Values returned are as in read_history (). */ ! extern int write_history __P((char *)); /* Append NELEMENT entries to FILENAME. The entries appended are from the end of the list minus NELEMENTs up to the end of the list. */ ! int append_history __P((int, char *)); /* Truncate the history file, leaving only the last NLINES lines. */ ! extern int history_truncate_file __P((char *, int)); /* History expansion. */ *************** *** 190,207 **** If an error ocurred in expansion, then OUTPUT contains a descriptive error message. */ ! extern int history_expand (); /* Extract a string segment consisting of the FIRST through LAST arguments present in STRING. Arguments are broken up as in the shell. */ ! extern char *history_arg_extract (); /* Return the text of the history event beginning at the current ! offset into STRING. */ ! extern char *get_history_event (); /* Return an array of tokens, much as the shell might. The tokens are parsed out of STRING. */ ! extern char **history_tokenize (); /* Exported history variables. */ --- 207,228 ---- If an error ocurred in expansion, then OUTPUT contains a descriptive error message. */ ! extern int history_expand __P((char *, char **)); /* Extract a string segment consisting of the FIRST through LAST arguments present in STRING. Arguments are broken up as in the shell. */ ! extern char *history_arg_extract __P((int, int, char *)); /* Return the text of the history event beginning at the current ! offset into STRING. Pass STRING with *INDEX equal to the ! history_expansion_char that begins this specification. ! DELIMITING_QUOTE is a character that is allowed to end the string ! specification for what to search for in addition to the normal ! characters `:', ` ', `\t', `\n', and sometimes `?'. */ ! extern char *get_history_event __P((char *, int *, int)); /* Return an array of tokens, much as the shell might. The tokens are parsed out of STRING. */ ! extern char **history_tokenize __P((char *)); /* Exported history variables. */ *************** *** 220,223 **** --- 241,248 ---- application and not expanded. */ extern Function *history_inhibit_expansion_function; + + #ifdef __cplusplus + } + #endif #endif /* !_HISTORY_H_ */ diff -aNrc2 bash-2.02.1/lib/readline/input.c bash-2.03/lib/readline/input.c *** bash-2.02.1/lib/readline/input.c Wed Dec 11 11:59:34 1996 --- bash-2.03/lib/readline/input.c Tue Sep 15 13:03:28 1998 *************** *** 125,160 **** } ! /* Add KEY to the buffer of characters to be read. */ ! int ! rl_stuff_char (key) ! int key; ! { ! if (key == EOF) ! { ! key = NEWLINE; ! rl_pending_input = EOF; ! } ! ibuffer[push_index++] = key; ! if (push_index >= ibuffer_len) ! push_index = 0; ! return push_index; ! } ! ! /* Make C be the next command to be executed. */ ! int ! rl_execute_next (c) ! int c; ! { ! rl_pending_input = c; ! return 0; ! } ! ! /* Return the amount of space available in the ! buffer for stuffing characters. */ static int ibuffer_space () { if (pop_index > push_index) ! return (pop_index - push_index); else return (ibuffer_len - (push_index - pop_index)); --- 125,135 ---- } ! /* Return the amount of space available in the buffer for stuffing ! characters. */ static int ibuffer_space () { if (pop_index > push_index) ! return (pop_index - push_index - 1); else return (ibuffer_len - (push_index - pop_index)); *************** *** 342,345 **** --- 317,350 ---- } + /* Add KEY to the buffer of characters to be read. Returns 1 if the + character was stuffed correctly; 0 otherwise. */ + int + rl_stuff_char (key) + int key; + { + if (ibuffer_space () == 0) + return 0; + + if (key == EOF) + { + key = NEWLINE; + rl_pending_input = EOF; + } + ibuffer[push_index++] = key; + if (push_index >= ibuffer_len) + push_index = 0; + + return 1; + } + + /* Make C be the next command to be executed. */ + int + rl_execute_next (c) + int c; + { + rl_pending_input = c; + return 0; + } + /* **************************************************************** */ /* */ *************** *** 409,412 **** --- 414,422 ---- if (result == 0) return (EOF); + + #if defined (__BEOS__) + if (errno == EINTR) + continue; + #endif #if defined (EWOULDBLOCK) diff -aNrc2 bash-2.02.1/lib/readline/isearch.c bash-2.03/lib/readline/isearch.c *** bash-2.02.1/lib/readline/isearch.c Tue Aug 12 12:55:24 1997 --- bash-2.03/lib/readline/isearch.c Tue Feb 2 13:26:54 1999 *************** *** 49,52 **** --- 49,55 ---- #include "history.h" + /* Variables exported to other files in the readline library. */ + unsigned char *_rl_isearch_terminators = (unsigned char *)NULL; + /* Variables imported from other files in the readline library. */ extern Keymap _rl_keymap; *************** *** 56,62 **** extern char *rl_line_buffer; - extern void _rl_save_prompt (); - extern void _rl_restore_prompt (); - extern int rl_execute_next (); extern void rl_extend_line_buffer (); --- 59,62 ---- *************** *** 179,182 **** --- 179,187 ---- int reverse; + /* The list of characters which terminate the search, but are not + subsequently executed. If the variable isearch-terminators has + been set, we use that value, otherwise we use ESC and C-J. */ + unsigned char *isearch_terminators; + orig_point = rl_point; last_found_line = orig_line = where_history (); *************** *** 185,188 **** --- 190,196 ---- allocated_line = (char *)NULL; + isearch_terminators = _rl_isearch_terminators ? _rl_isearch_terminators + : (unsigned char *)"\033\012"; + /* Create an arrary of pointers to the lines that we want to search. */ maybe_replace_line (); *************** *** 212,216 **** i = orig_line; ! _rl_save_prompt (); /* Initialize search parameters. */ --- 220,224 ---- i = orig_line; ! rl_save_prompt (); /* Initialize search parameters. */ *************** *** 247,254 **** --- 255,270 ---- } + #if 0 /* Let NEWLINE (^J) terminate the search for people who don't like using ESC. ^M can still be used to terminate the search and immediately execute the command. */ if (c == ESC || c == NEWLINE) + #else + /* The characters in isearch_terminators (set from the user-settable + variable isearch-terminators) are used to terminate the search but + not subsequently execute the character as a command. The default + value is "\033\012" (ESC and C-J). */ + if (strchr (isearch_terminators, c)) + #endif { /* ESC still terminates the search, but if there is pending *************** *** 292,296 **** rl_point = orig_point; rl_end = strlen (rl_line_buffer); ! _rl_restore_prompt(); rl_clear_message (); if (allocated_line) --- 308,312 ---- rl_point = orig_point; rl_end = strlen (rl_line_buffer); ! rl_restore_prompt(); rl_clear_message (); if (allocated_line) *************** *** 410,414 **** strcpy (rl_line_buffer, lines[orig_line]); ! _rl_restore_prompt (); /* Free the search string. */ --- 426,430 ---- strcpy (rl_line_buffer, lines[orig_line]); ! rl_restore_prompt (); /* Free the search string. */ *************** *** 416,422 **** if (last_found_line < orig_line) ! rl_get_previous_history (orig_line - last_found_line); else ! rl_get_next_history (last_found_line - orig_line); /* If the string was not found, put point at the end of the line. */ --- 432,438 ---- if (last_found_line < orig_line) ! rl_get_previous_history (orig_line - last_found_line, 0); else ! rl_get_next_history (last_found_line - orig_line, 0); /* If the string was not found, put point at the end of the line. */ diff -aNrc2 bash-2.02.1/lib/readline/keymaps.c bash-2.03/lib/readline/keymaps.c *** bash-2.02.1/lib/readline/keymaps.c Mon Mar 27 14:56:38 1995 --- bash-2.03/lib/readline/keymaps.c Fri Jun 5 15:37:34 1998 *************** *** 125,129 **** void rl_discard_keymap (map) ! Keymap (map); { int i; --- 125,129 ---- void rl_discard_keymap (map) ! Keymap map; { int i; diff -aNrc2 bash-2.02.1/lib/readline/keymaps.h bash-2.03/lib/readline/keymaps.h *** bash-2.02.1/lib/readline/keymaps.h Thu Sep 4 13:11:41 1997 --- bash-2.03/lib/readline/keymaps.h Fri Jun 5 15:41:19 1998 *************** *** 25,30 **** --- 25,32 ---- #if defined (READLINE_LIBRARY) + # include "rlstdc.h" # include "chardefs.h" #else + # include # include #endif *************** *** 71,95 **** /* Return a new, empty keymap. Free it with free() when you are done. */ ! extern Keymap rl_make_bare_keymap (); /* Return a new keymap which is a copy of MAP. */ ! extern Keymap rl_copy_keymap (); /* Return a new keymap with the printing characters bound to rl_insert, the lowercase Meta characters bound to run their equivalents, and the Meta digits bound to produce numeric arguments. */ ! extern Keymap rl_make_keymap (); ! extern void rl_discard_keymap (); /* Return the keymap corresponding to a given name. Names look like ! `emacs' or `emacs-meta' or `vi-insert'. */ ! extern Keymap rl_get_keymap_by_name (); /* Return the current keymap. */ ! extern Keymap rl_get_keymap (); /* Set the current keymap to MAP. */ ! extern void rl_set_keymap (); #endif /* _KEYMAPS_H_ */ --- 73,100 ---- /* Return a new, empty keymap. Free it with free() when you are done. */ ! extern Keymap rl_make_bare_keymap __P((void)); /* Return a new keymap which is a copy of MAP. */ ! extern Keymap rl_copy_keymap __P((Keymap)); /* Return a new keymap with the printing characters bound to rl_insert, the lowercase Meta characters bound to run their equivalents, and the Meta digits bound to produce numeric arguments. */ ! extern Keymap rl_make_keymap __P((void)); ! /* Free the storage associated with a keymap. */ ! extern void rl_discard_keymap __P((Keymap)); ! ! /* These functions actually appear in bind.c */ /* Return the keymap corresponding to a given name. Names look like ! `emacs' or `emacs-meta' or `vi-insert'. */ ! extern Keymap rl_get_keymap_by_name __P((char *)); /* Return the current keymap. */ ! extern Keymap rl_get_keymap __P((void)); /* Set the current keymap to MAP. */ ! extern void rl_set_keymap __P((Keymap)); #endif /* _KEYMAPS_H_ */ diff -aNrc2 bash-2.02.1/lib/readline/kill.c bash-2.03/lib/readline/kill.c *** bash-2.02.1/lib/readline/kill.c Wed Jul 9 15:10:26 1997 --- bash-2.03/lib/readline/kill.c Tue Jun 30 17:16:16 1998 *************** *** 573,576 **** --- 573,578 ---- static int count_passed = 1; static int direction = 1; + static int undo_needed = 0; + int retval; if (rl_last_func != rl_yank_last_arg) *************** *** 583,587 **** else { ! rl_do_undo (); if (count < 1) direction = -direction; --- 585,590 ---- else { ! if (undo_needed) ! rl_do_undo (); if (count < 1) direction = -direction; *************** *** 589,599 **** if (history_skip < 0) history_skip = 0; - count_passed = count; } if (explicit_arg_p) ! return (rl_yank_nth_arg_internal (count, key, history_skip)); else ! return (rl_yank_nth_arg_internal ('$', key, history_skip)); } --- 592,604 ---- if (history_skip < 0) history_skip = 0; } if (explicit_arg_p) ! retval = rl_yank_nth_arg_internal (count_passed, key, history_skip); else ! retval = rl_yank_nth_arg_internal ('$', key, history_skip); ! ! undo_needed = retval == 0; ! return retval; } diff -aNrc2 bash-2.02.1/lib/readline/parens.c bash-2.03/lib/readline/parens.c *** bash-2.02.1/lib/readline/parens.c Fri Feb 20 16:38:30 1998 --- bash-2.03/lib/readline/parens.c Wed Jun 3 13:43:28 1998 *************** *** 103,107 **** FD_SET (fileno (rl_instream), &readfds); timer.tv_sec = 0; ! timer.tv_usec = 500; orig_point = rl_point; --- 103,107 ---- FD_SET (fileno (rl_instream), &readfds); timer.tv_sec = 0; ! timer.tv_usec = 500000; orig_point = rl_point; diff -aNrc2 bash-2.02.1/lib/readline/posixjmp.h bash-2.03/lib/readline/posixjmp.h *** bash-2.02.1/lib/readline/posixjmp.h Thu Jan 16 13:54:33 1997 --- bash-2.03/lib/readline/posixjmp.h Thu Feb 18 12:34:51 1999 *************** *** 10,17 **** #if defined (HAVE_POSIX_SIGSETJMP) # define procenv_t sigjmp_buf ! # undef setjmp ! # define setjmp(x) sigsetjmp((x), 1) ! # undef longjmp ! # define longjmp(x, n) siglongjmp((x), (n)) #else # define procenv_t jmp_buf --- 10,19 ---- #if defined (HAVE_POSIX_SIGSETJMP) # define procenv_t sigjmp_buf ! # if !defined (__OPENNT) ! # undef setjmp ! # define setjmp(x) sigsetjmp((x), 1) ! # undef longjmp ! # define longjmp(x, n) siglongjmp((x), (n)) ! # endif /* !__OPENNT */ #else # define procenv_t jmp_buf diff -aNrc2 bash-2.02.1/lib/readline/readline.c bash-2.03/lib/readline/readline.c *** bash-2.02.1/lib/readline/readline.c Thu Apr 2 11:16:12 1998 --- bash-2.03/lib/readline/readline.c Thu Dec 31 10:10:10 1998 *************** *** 65,69 **** #ifndef RL_LIBRARY_VERSION ! # define RL_LIBRARY_VERSION "2.2-bash" #endif --- 65,69 ---- #ifndef RL_LIBRARY_VERSION ! # define RL_LIBRARY_VERSION "4.0" #endif *************** *** 84,88 **** extern int _rl_output_character_function (); #endif - extern void _rl_get_screen_size (); extern int _rl_enable_meta; --- 84,87 ---- *************** *** 101,105 **** /* Functions imported from bind.c. */ extern void _rl_bind_if_unbound (); - extern int rl_set_keymap_from_edit_mode (); /* Functions imported from input.c. */ --- 100,103 ---- *************** *** 119,125 **** extern void _rl_clear_to_eol (); extern void _rl_clear_screen (); ! ! extern void _rl_save_prompt (); ! extern void _rl_restore_prompt (); extern void _rl_erase_at_end_of_line (); --- 117,121 ---- extern void _rl_clear_to_eol (); extern void _rl_clear_screen (); ! extern void _rl_erase_entire_line (); extern void _rl_erase_at_end_of_line (); *************** *** 254,260 **** /* If non-zero, then this is the address of a function to call just ! before readline_internal () prints the first prompt. */ Function *rl_startup_hook = (Function *)NULL; /* What we use internally. You should always refer to RL_LINE_BUFFER. */ static char *the_line; --- 250,261 ---- /* If non-zero, then this is the address of a function to call just ! before readline_internal_setup () prints the first prompt. */ Function *rl_startup_hook = (Function *)NULL; + /* If non-zero, this is the address of a function to call just before + readline_internal_setup () returns and readline_internal starts + reading input characters. */ + Function *rl_pre_input_hook = (Function *)NULL; + /* What we use internally. You should always refer to RL_LINE_BUFFER. */ static char *the_line; *************** *** 287,290 **** --- 288,294 ---- Keymap rl_executing_keymap; + /* Non-zero means to erase entire line, including prompt, on empty input lines. */ + int rl_erase_empty_line = 0; + /* Line buffer and maintenence. */ char *rl_line_buffer = (char *)NULL; *************** *** 389,392 **** --- 393,399 ---- #endif /* VI_MODE */ } + + if (rl_pre_input_hook) + (*rl_pre_input_hook) (); } *************** *** 406,410 **** temp = savestring (the_line); rl_revert_line (1, 0); ! entry = replace_history_entry (where_history (), the_line, (HIST_ENTRY *)NULL); _rl_free_history_entry (entry); --- 413,417 ---- temp = savestring (the_line); rl_revert_line (1, 0); ! entry = replace_history_entry (where_history (), the_line, (histdata_t)NULL); _rl_free_history_entry (entry); *************** *** 489,492 **** --- 496,505 ---- (*rl_redisplay_function) (); + /* If the application writer has told us to erase the entire line if + the only character typed was something bound to rl_newline, do so. */ + if (rl_erase_empty_line && rl_done && rl_last_func == rl_newline && + rl_point == 0 && rl_end == 0) + _rl_erase_entire_line (); + #if defined (READLINE_CALLBACKS) return 0; *************** *** 502,506 **** readline_internal_charloop () { ! int eof; while (rl_done == 0) --- 515,519 ---- readline_internal_charloop () { ! int eof = 1; while (rl_done == 0) *************** *** 838,846 **** int key, c, sawminus, sawdigits; ! _rl_save_prompt (); sawminus = sawdigits = 0; while (1) { rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg); key = c = rl_read_key (); --- 851,867 ---- int key, c, sawminus, sawdigits; ! rl_save_prompt (); sawminus = sawdigits = 0; while (1) { + if (rl_numeric_arg > 1000000) + { + sawdigits = rl_explicit_arg = rl_numeric_arg = 0; + ding (); + rl_restore_prompt (); + rl_clear_message (); + return 1; + } rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg); key = c = rl_read_key (); *************** *** 859,863 **** { key = rl_read_key (); ! _rl_restore_prompt (); rl_clear_message (); return (_rl_dispatch (key, _rl_keymap)); --- 880,884 ---- { key = rl_read_key (); ! rl_restore_prompt (); rl_clear_message (); return (_rl_dispatch (key, _rl_keymap)); *************** *** 882,886 **** if (sawminus && rl_numeric_arg == 1 && rl_explicit_arg == 0) rl_explicit_arg = 1; ! _rl_restore_prompt (); rl_clear_message (); return (_rl_dispatch (key, _rl_keymap)); --- 903,907 ---- if (sawminus && rl_numeric_arg == 1 && rl_explicit_arg == 0) rl_explicit_arg = 1; ! rl_restore_prompt (); rl_clear_message (); return (_rl_dispatch (key, _rl_keymap)); *************** *** 1232,1236 **** /* Clear the current line. Numeric argument to C-l does this. */ int ! rl_refresh_line () { int curr_line, nleft; --- 1253,1258 ---- /* Clear the current line. Numeric argument to C-l does this. */ int ! rl_refresh_line (ignore1, ignore2) ! int ignore1, ignore2; { int curr_line, nleft; *************** *** 1279,1283 **** if (rl_explicit_arg) { ! rl_refresh_line (); return 0; } --- 1301,1305 ---- if (rl_explicit_arg) { ! rl_refresh_line (count, key); return 0; } *************** *** 1429,1432 **** --- 1451,1459 ---- #endif /* VI_MODE */ + /* If we've been asked to erase empty lines, suppress the final update, + since _rl_update_final calls crlf(). */ + if (rl_erase_empty_line && rl_point == 0 && rl_end == 0) + return 0; + if (readline_echoing_p) _rl_update_final (); *************** *** 1508,1514 **** else return (rl_delete_text (rl_point, rl_point + 1)); - } /* Delete all spaces and tabs around point. */ int --- 1535,1554 ---- else return (rl_delete_text (rl_point, rl_point + 1)); } + /* Delete the character under the cursor, unless the insertion + point is at the end of the line, in which case the character + behind the cursor is deleted. COUNT is obeyed and may be used + to delete forward or backward that many characters. */ + int + rl_rubout_or_delete (count, key) + int count, key; + { + if (rl_end != 0 && rl_point == rl_end) + return (rl_rubout (count, key)); + else + return (rl_delete (count, key)); + } + /* Delete all spaces and tabs around point. */ int *************** *** 1534,1537 **** --- 1574,1590 ---- } + /* Like the tcsh editing function delete-char-or-list. The eof character + is caught before this is invoked, so this really does the same thing as + delete-char-or-list-or-eof, as long as it's bound to the eof character. */ + int + rl_delete_or_show_completions (count, key) + int count, key; + { + if (rl_end != 0 && rl_point == rl_end) + return (rl_possible_completions (count, key)); + else + return (rl_delete (count, key)); + } + #ifndef RL_COMMENT_BEGIN_DEFAULT #define RL_COMMENT_BEGIN_DEFAULT "#" *************** *** 1860,1864 **** if (temp && ((UNDO_LIST *)(temp->data) != rl_undo_list)) { ! temp = replace_history_entry (where_history (), the_line, rl_undo_list); free (temp->line); free (temp); --- 1913,1917 ---- if (temp && ((UNDO_LIST *)(temp->data) != rl_undo_list)) { ! temp = replace_history_entry (where_history (), the_line, (histdata_t)rl_undo_list); free (temp->line); free (temp); diff -aNrc2 bash-2.02.1/lib/readline/readline.h bash-2.03/lib/readline/readline.h *** bash-2.02.1/lib/readline/readline.h Mon Sep 8 16:00:15 1997 --- bash-2.03/lib/readline/readline.h Thu Dec 31 10:10:15 1998 *************** *** 24,31 **** --- 24,37 ---- #define _READLINE_H_ + #ifdef __cplusplus + extern "C" { + #endif + #if defined (READLINE_LIBRARY) + # include "rlstdc.h" # include "keymaps.h" # include "tilde.h" #else + # include # include # include *************** *** 61,136 **** extern FUNMAP **funmap; ! /* Functions available to bind to key sequences. */ ! extern int ! rl_tilde_expand (), rl_set_mark (), rl_exchange_point_and_mark (), ! rl_beg_of_line (), rl_backward (), rl_delete (), rl_end_of_line (), ! rl_forward (), ding (), rl_newline (), rl_kill_line (), ! rl_copy_region_to_kill (), rl_kill_region (), rl_char_search (), ! rl_clear_screen (), rl_get_next_history (), rl_get_previous_history (), ! rl_quoted_insert (), rl_reverse_search_history (), rl_transpose_chars (), ! rl_unix_line_discard (), rl_unix_word_rubout (), ! rl_yank (), rl_rubout (), rl_backward_word (), rl_kill_word (), ! rl_forward_word (), rl_tab_insert (), rl_yank_pop (), rl_yank_nth_arg (), ! rl_backward_kill_word (), rl_backward_kill_line (), rl_transpose_words (), ! rl_complete (), rl_possible_completions (), rl_insert_completions (), ! rl_menu_complete (), ! rl_do_lowercase_version (), rl_kill_full_line (), ! rl_digit_argument (), rl_universal_argument (), rl_abort (), ! rl_undo_command (), rl_revert_line (), rl_beginning_of_history (), ! rl_end_of_history (), rl_forward_search_history (), rl_insert (), ! rl_upcase_word (), rl_downcase_word (), rl_capitalize_word (), ! rl_restart_output (), rl_re_read_init_file (), ! rl_dump_functions (), rl_dump_variables (), rl_dump_macros (), ! rl_delete_horizontal_space (), rl_history_search_forward (), ! rl_history_search_backward (), rl_tty_status (), rl_yank_last_arg (), ! rl_insert_comment (), rl_backward_char_search (), ! rl_copy_forward_word (), rl_copy_backward_word (); ! ! /* Not available unless readline is compiled -DPAREN_MATCHING. */ ! extern int rl_insert_close (); ! ! /* Not available unless READLINE_CALLBACKS is defined. */ ! extern void rl_callback_handler_install (); ! extern void rl_callback_read_char (); ! extern void rl_callback_handler_remove (); /* Not available unless __CYGWIN32__ is defined. */ #ifdef __CYGWIN32__ ! extern int rl_paste_from_clipboard (); #endif ! /* These are *both* defined even when VI_MODE is not. */ ! extern int rl_vi_editing_mode (), rl_emacs_editing_mode (); ! /* Non incremental history searching. */ ! extern int rl_noninc_forward_search (); ! extern int rl_noninc_reverse_search (); ! extern int rl_noninc_forward_search_again (); ! extern int rl_noninc_reverse_search_again (); ! /* Things for vi mode. Not available unless readline is compiled -DVI_MODE. */ ! extern int rl_vi_check (); ! extern int ! rl_vi_undo (), rl_vi_redo (), rl_vi_tilde_expand (), ! rl_vi_movement_mode (), rl_vi_insertion_mode (), rl_vi_arg_digit (), ! rl_vi_prev_word (), rl_vi_next_word (), rl_vi_char_search (), ! rl_vi_eof_maybe (), rl_vi_append_mode (), rl_vi_put (), ! rl_vi_append_eol (), rl_vi_insert_beg (), rl_vi_delete (), ! rl_vi_first_print (), rl_vi_fword (), rl_vi_fWord (), rl_vi_bword (), ! rl_vi_bWord (), rl_vi_eword (), rl_vi_eWord (), rl_vi_end_word (), ! rl_vi_change_case (), rl_vi_match (), rl_vi_bracktype (), ! rl_vi_change_char (), rl_vi_yank_arg (), rl_vi_search (), ! rl_vi_search_again (), rl_vi_subst (), rl_vi_overstrike (), ! rl_vi_overstrike_delete (), rl_vi_replace(), rl_vi_column (), ! rl_vi_delete_to (), rl_vi_change_to (), rl_vi_yank_to (), ! rl_vi_complete (), rl_vi_fetch_history (), rl_vi_set_mark (), ! rl_vi_goto_mark (), rl_vi_back_to_indent (); ! ! /* Keyboard macro commands. */ ! extern int rl_start_kbd_macro (), rl_end_kbd_macro (); ! extern int rl_call_last_kbd_macro (); ! extern void rl_push_macro_input (); ! extern int rl_arrow_keys(), rl_refresh_line (); /* **************************************************************** */ --- 67,255 ---- extern FUNMAP **funmap; ! /* **************************************************************** */ ! /* */ ! /* Functions available to bind to key sequences */ ! /* */ ! /* **************************************************************** */ + /* Bindable commands for numeric arguments. */ + extern int rl_digit_argument __P((int, int)); + extern int rl_universal_argument __P((int, int)); + + /* Bindable commands for moving the cursor. */ + extern int rl_forward __P((int, int)); + extern int rl_backward __P((int, int)); + extern int rl_beg_of_line __P((int, int)); + extern int rl_end_of_line __P((int, int)); + extern int rl_forward_word __P((int, int)); + extern int rl_backward_word __P((int, int)); + extern int rl_refresh_line __P((int, int)); + extern int rl_clear_screen __P((int, int)); + extern int rl_arrow_keys __P((int, int)); + + /* Bindable commands for inserting and deleting text. */ + extern int rl_insert __P((int, int)); + extern int rl_quoted_insert __P((int, int)); + extern int rl_tab_insert __P((int, int)); + extern int rl_newline __P((int, int)); + extern int rl_do_lowercase_version __P((int, int)); + extern int rl_rubout __P((int, int)); + extern int rl_delete __P((int, int)); + extern int rl_rubout_or_delete __P((int, int)); + extern int rl_delete_horizontal_space __P((int, int)); + extern int rl_delete_or_show_completions __P((int, int)); + extern int rl_insert_comment __P((int, int)); + + /* Bindable commands for changing case. */ + extern int rl_upcase_word __P((int, int)); + extern int rl_downcase_word __P((int, int)); + extern int rl_capitalize_word __P((int, int)); + + /* Bindable commands for transposing characters and words. */ + extern int rl_transpose_words __P((int, int)); + extern int rl_transpose_chars __P((int, int)); + + /* Bindable commands for searching within a line. */ + extern int rl_char_search __P((int, int)); + extern int rl_backward_char_search __P((int, int)); + + /* Bindable commands for readline's interface to the command history. */ + extern int rl_beginning_of_history __P((int, int)); + extern int rl_end_of_history __P((int, int)); + extern int rl_get_next_history __P((int, int)); + extern int rl_get_previous_history __P((int, int)); + + /* Bindable commands for managing the mark and region. */ + extern int rl_set_mark __P((int, int)); + extern int rl_exchange_point_and_mark __P((int, int)); + + /* Bindable commands to set the editing mode (emacs or vi). */ + extern int rl_vi_editing_mode __P((int, int)); + extern int rl_emacs_editing_mode __P((int, int)); + + /* Bindable commands for managing key bindings. */ + extern int rl_re_read_init_file __P((int, int)); + extern int rl_dump_functions __P((int, int)); + extern int rl_dump_macros __P((int, int)); + extern int rl_dump_variables __P((int, int)); + + /* Bindable commands for word completion. */ + extern int rl_complete __P((int, int)); + extern int rl_possible_completions __P((int, int)); + extern int rl_insert_completions __P((int, int)); + extern int rl_menu_complete __P((int, int)); + + /* Bindable commands for killing and yanking text, and managing the kill ring. */ + extern int rl_kill_word __P((int, int)); + extern int rl_backward_kill_word __P((int, int)); + extern int rl_kill_line __P((int, int)); + extern int rl_backward_kill_line __P((int, int)); + extern int rl_kill_full_line __P((int, int)); + extern int rl_unix_word_rubout __P((int, int)); + extern int rl_unix_line_discard __P((int, int)); + extern int rl_copy_region_to_kill __P((int, int)); + extern int rl_kill_region __P((int, int)); + extern int rl_copy_forward_word __P((int, int)); + extern int rl_copy_backward_word __P((int, int)); + extern int rl_yank __P((int, int)); + extern int rl_yank_pop __P((int, int)); + extern int rl_yank_nth_arg __P((int, int)); + extern int rl_yank_last_arg __P((int, int)); /* Not available unless __CYGWIN32__ is defined. */ #ifdef __CYGWIN32__ ! extern int rl_paste_from_clipboard __P((int, int)); #endif ! /* Bindable commands for incremental searching. */ ! extern int rl_reverse_search_history __P((int, int)); ! extern int rl_forward_search_history __P((int, int)); ! ! /* Bindable keyboard macro commands. */ ! extern int rl_start_kbd_macro __P((int, int)); ! extern int rl_end_kbd_macro __P((int, int)); ! extern int rl_call_last_kbd_macro __P((int, int)); ! ! /* Bindable undo commands. */ ! extern int rl_revert_line __P((int, int)); ! extern int rl_undo_command __P((int, int)); ! ! /* Bindable tilde expansion commands. */ ! extern int rl_tilde_expand __P((int, int)); ! ! /* Bindable terminal control commands. */ ! extern int rl_restart_output __P((int, int)); ! extern int rl_stop_output __P((int, int)); ! ! /* Miscellaneous bindable commands. */ ! extern int rl_abort __P((int, int)); ! extern int rl_tty_status __P((int, int)); ! ! /* Bindable commands for incremental and non-incremental history searching. */ ! extern int rl_history_search_forward __P((int, int)); ! extern int rl_history_search_backward __P((int, int)); ! extern int rl_noninc_forward_search __P((int, int)); ! extern int rl_noninc_reverse_search __P((int, int)); ! extern int rl_noninc_forward_search_again __P((int, int)); ! extern int rl_noninc_reverse_search_again __P((int, int)); ! /* Not available unless readline is compiled -DPAREN_MATCHING. */ ! extern int rl_insert_close __P((int, int)); ! /* Not available unless READLINE_CALLBACKS is defined. */ ! extern void rl_callback_handler_install __P((char *, VFunction *)); ! extern void rl_callback_read_char __P((void)); ! extern void rl_callback_handler_remove __P((void)); ! /* Things for vi mode. Not available unless readline is compiled -DVI_MODE. */ ! /* VI-mode bindable commands. */ ! extern int rl_vi_redo __P((int, int)); ! extern int rl_vi_undo __P((int, int)); ! extern int rl_vi_yank_arg __P((int, int)); ! extern int rl_vi_fetch_history __P((int, int)); ! extern int rl_vi_search_again __P((int, int)); ! extern int rl_vi_search __P((int, int)); ! extern int rl_vi_complete __P((int, int)); ! extern int rl_vi_tilde_expand __P((int, int)); ! extern int rl_vi_prev_word __P((int, int)); ! extern int rl_vi_next_word __P((int, int)); ! extern int rl_vi_end_word __P((int, int)); ! extern int rl_vi_insert_beg __P((int, int)); ! extern int rl_vi_append_mode __P((int, int)); ! extern int rl_vi_append_eol __P((int, int)); ! extern int rl_vi_eof_maybe __P((int, int)); ! extern int rl_vi_insertion_mode __P((int, int)); ! extern int rl_vi_movement_mode __P((int, int)); ! extern int rl_vi_arg_digit __P((int, int)); ! extern int rl_vi_change_case __P((int, int)); ! extern int rl_vi_put __P((int, int)); ! extern int rl_vi_column __P((int, int)); ! extern int rl_vi_delete_to __P((int, int)); ! extern int rl_vi_change_to __P((int, int)); ! extern int rl_vi_yank_to __P((int, int)); ! extern int rl_vi_delete __P((int, int)); ! extern int rl_vi_back_to_indent __P((int, int)); ! extern int rl_vi_first_print __P((int, int)); ! extern int rl_vi_char_search __P((int, int)); ! extern int rl_vi_match __P((int, int)); ! extern int rl_vi_change_char __P((int, int)); ! extern int rl_vi_subst __P((int, int)); ! extern int rl_vi_overstrike __P((int, int)); ! extern int rl_vi_overstrike_delete __P((int, int)); ! extern int rl_vi_replace __P((int, int)); ! extern int rl_vi_set_mark __P((int, int)); ! extern int rl_vi_goto_mark __P((int, int)); ! ! /* VI-mode utility functions. */ ! extern int rl_vi_check __P((void)); ! extern int rl_vi_domove __P((int, int *)); ! extern int rl_vi_bracktype __P((int)); ! ! /* VI-mode pseudo-bindable commands, used as utility functions. */ ! extern int rl_vi_fWord __P((int, int)); ! extern int rl_vi_bWord __P((int, int)); ! extern int rl_vi_eWord __P((int, int)); ! extern int rl_vi_fword __P((int, int)); ! extern int rl_vi_bword __P((int, int)); ! extern int rl_vi_eword __P((int, int)); /* **************************************************************** */ *************** *** 142,196 **** /* Readline functions. */ /* Read a line of input. Prompt with PROMPT. A NULL PROMPT means none. */ ! extern char *readline (); ! /* These functions are from bind.c. */ ! /* rl_add_defun (char *name, Function *function, int key) ! Add NAME to the list of named functions. Make FUNCTION ! be the function that gets called. ! If KEY is not -1, then bind it. */ ! extern int rl_add_defun (); ! ! extern Keymap rl_make_bare_keymap (); ! extern Keymap rl_copy_keymap (); ! extern Keymap rl_make_keymap (); ! extern void rl_discard_keymap (); ! extern Keymap rl_get_keymap (), rl_get_keymap_by_name (); ! extern void rl_set_keymap (); ! extern char *rl_get_keymap_name (); ! ! extern int rl_bind_key (), rl_bind_key_in_map (); ! extern int rl_unbind_key (), rl_unbind_key_in_map (); ! extern int rl_unbind_function_in_map (), rl_unbind_command_in_map (); ! extern int rl_set_key (); ! extern int rl_generic_bind (); ! extern int rl_parse_and_bind (); ! /* Backwards compatibility, use rl_generic_bind instead. */ ! extern int rl_macro_bind (), rl_variable_bind (); ! extern int rl_read_init_file (); ! extern Function *rl_named_function (), *rl_function_of_keyseq (); ! extern char **rl_invoking_keyseqs (), **rl_invoking_keyseqs_in_map (); ! extern void rl_function_dumper (); ! extern void rl_variable_dumper (); ! extern void rl_macro_dumper (); ! extern void rl_list_funmap_names (); /* Undocumented in the texinfo manual; not really useful to programs. */ ! extern int rl_translate_keyseq (); ! extern void rl_initialize_funmap (); ! /* Functions for undoing. */ ! extern int rl_begin_undo_group (), rl_end_undo_group (); ! extern void rl_add_undo (), free_undo_list (); ! extern int rl_do_undo (); ! extern int rl_modifying (); /* Functions for redisplay. */ ! extern void rl_redisplay (); ! extern int rl_forced_update_display (); ! extern int rl_clear_message (); ! extern int rl_reset_line_state (); ! extern int rl_on_new_line (); #if defined (__STDC__) && defined (USE_VARARGS) && defined (PREFER_STDARG) --- 261,338 ---- /* Readline functions. */ /* Read a line of input. Prompt with PROMPT. A NULL PROMPT means none. */ ! extern char *readline __P((char *)); ! extern int rl_initialize __P((void)); ! extern int rl_discard_argument __P((void)); ! /* Utility functions to bind keys to readline commands. */ ! extern int rl_add_defun __P((char *, Function *, int)); ! extern int rl_bind_key __P((int, Function *)); ! extern int rl_bind_key_in_map __P((int, Function *, Keymap)); ! extern int rl_unbind_key __P((int)); ! extern int rl_unbind_key_in_map __P((int, Keymap)); ! extern int rl_unbind_function_in_map __P((Function *, Keymap)); ! extern int rl_unbind_command_in_map __P((char *, Keymap)); ! extern int rl_set_key __P((char *, Function *, Keymap)); ! extern int rl_generic_bind __P((int, char *, char *, Keymap)); ! extern int rl_variable_bind __P((char *, char *)); ! ! /* Backwards compatibility, use rl_generic_bind instead. */ ! extern int rl_macro_bind __P((char *, char *, Keymap)); /* Undocumented in the texinfo manual; not really useful to programs. */ ! extern int rl_translate_keyseq __P((char *, char *, int *)); ! extern char *rl_untranslate_keyseq __P((int)); ! extern Function *rl_named_function __P((char *)); ! extern Function *rl_function_of_keyseq __P((char *, Keymap, int *)); ! ! extern void rl_list_funmap_names __P((void)); ! extern char **rl_invoking_keyseqs_in_map __P((Function *, Keymap)); ! extern char **rl_invoking_keyseqs __P((Function *)); ! ! extern void rl_function_dumper __P((int)); ! extern void rl_macro_dumper __P((int)); ! extern void rl_variable_dumper __P((int)); ! ! extern int rl_read_init_file __P((char *)); ! extern int rl_parse_and_bind __P((char *)); ! ! /* Functions for manipulating keymaps. */ ! extern Keymap rl_make_bare_keymap __P((void)); ! extern Keymap rl_copy_keymap __P((Keymap)); ! extern Keymap rl_make_keymap __P((void)); ! extern void rl_discard_keymap __P((Keymap)); ! ! extern Keymap rl_get_keymap_by_name __P((char *)); ! extern char *rl_get_keymap_name __P((Keymap)); ! extern void rl_set_keymap __P((Keymap)); ! extern Keymap rl_get_keymap __P((void)); ! extern void rl_set_keymap_from_edit_mode __P((void)); ! extern char *rl_get_keymap_name_from_edit_mode __P((void)); ! ! /* Functions for manipulating the funmap, which maps command names to functions. */ ! extern int rl_add_funmap_entry __P((char *, Function *)); ! extern void rl_initialize_funmap __P((void)); ! extern char **rl_funmap_names __P((void)); ! ! /* Utility functions for managing keyboard macros. */ ! extern void rl_push_macro_input __P((char *)); ! ! /* Functions for undoing, from undo.c */ ! extern void rl_add_undo __P((enum undo_code, int, int, char *)); ! extern void free_undo_list __P((void)); ! extern int rl_do_undo __P((void)); ! extern int rl_begin_undo_group __P((void)); ! extern int rl_end_undo_group __P((void)); ! extern int rl_modifying __P((int, int)); /* Functions for redisplay. */ ! extern void rl_redisplay __P((void)); ! extern int rl_on_new_line __P((void)); ! extern int rl_forced_update_display __P((void)); ! extern int rl_clear_message __P((void)); ! extern int rl_reset_line_state __P((void)); #if defined (__STDC__) && defined (USE_VARARGS) && defined (PREFER_STDARG) *************** *** 201,234 **** /* Undocumented in texinfo manual. */ ! extern int rl_character_len (); ! extern int rl_show_char (); ! extern int crlf (); /* Modifying text. */ ! extern int rl_insert_text (), rl_delete_text (); ! extern int rl_kill_text (); ! extern char *rl_copy_text (); ! ! /* `Public' utility functions. */ ! extern int rl_reset_terminal (); ! extern int rl_stuff_char (); ! extern int rl_read_key (), rl_getc (); ! ! extern int rl_initialize (); ! /* Undocumented. */ ! extern int rl_expand_prompt (); ! extern int rl_set_signals (), rl_clear_signals (); ! extern int maybe_save_line (), maybe_unsave_line (), maybe_replace_line (); /* Completion functions. */ ! /* These functions are from complete.c. */ ! extern int rl_complete_internal (); ! /* Return an array of strings which are the result of repeatadly calling ! FUNC with TEXT. */ ! extern char **completion_matches (); ! extern char *username_completion_function (); ! extern char *filename_completion_function (); /* **************************************************************** */ --- 343,399 ---- /* Undocumented in texinfo manual. */ ! extern int rl_show_char __P((int)); ! extern int rl_character_len __P((int, int)); ! extern int crlf __P((void)); ! ! /* Save and restore internal prompt redisplay information. */ ! extern void rl_save_prompt __P((void)); ! extern void rl_restore_prompt __P((void)); /* Modifying text. */ ! extern int rl_insert_text __P((char *)); ! extern int rl_delete_text __P((int, int)); ! extern int rl_kill_text __P((int, int)); ! extern char *rl_copy_text __P((int, int)); ! ! /* Terminal and tty mode management. */ ! extern void rl_prep_terminal __P((int)); ! extern void rl_deprep_terminal __P((void)); ! extern void rltty_set_default_bindings __P((Keymap)); ! ! extern int rl_reset_terminal __P((char *)); ! extern void rl_resize_terminal __P((void)); ! ! /* `Public' utility functions . */ ! extern void rl_extend_line_buffer __P((int)); ! extern int ding __P((void)); ! ! /* Functions for character input. */ ! extern int rl_stuff_char __P((int)); ! extern int rl_execute_next __P((int)); ! extern int rl_read_key __P((void)); ! extern int rl_getc __P((FILE *)); ! ! /* Readline signal handling, from signals.c */ ! extern int rl_set_signals __P((void)); ! extern int rl_clear_signals __P((void)); ! extern void rl_cleanup_after_signal __P((void)); ! extern void rl_reset_after_signal __P((void)); ! extern void rl_free_line_state __P((void)); ! /* Undocumented. */ ! extern int rl_expand_prompt __P((char *)); ! ! extern int maybe_save_line __P((void)); ! extern int maybe_unsave_line __P((void)); ! extern int maybe_replace_line __P((void)); /* Completion functions. */ ! extern int rl_complete_internal __P((int)); ! extern void rl_display_match_list __P((char **, int, int)); ! extern char **completion_matches __P((char *, CPFunction *)); ! extern char *username_completion_function __P((char *, int)); ! extern char *filename_completion_function __P((char *, int)); /* **************************************************************** */ *************** *** 255,262 **** --- 420,431 ---- extern int rl_point, rl_end; + /* The mark, or saved cursor position. */ extern int rl_mark; + /* Flag to indicate that readline has finished with the current input + line and should return it. */ extern int rl_done; + /* If set to a character value, that will be the next keystroke read. */ extern int rl_pending_input; *************** *** 276,279 **** --- 445,453 ---- extern Function *rl_startup_hook; + /* If non-zero, this is the address of a function to call just before + readline_internal_setup () returns and readline_internal starts + reading input characters. */ + extern Function *rl_pre_input_hook; + /* The address of a function to call periodically while Readline is awaiting character input, or NULL, for no event handling. */ *************** *** 289,292 **** --- 463,484 ---- extern Keymap rl_binding_keymap; + /* Display variables. */ + /* If non-zero, readline will erase the entire line, including any prompt, + if the only thing typed on an otherwise-blank line is something bound to + rl_newline. */ + extern int rl_erase_empty_line; + + /* Variables to control readline signal handling. */ + /* If non-zero, readline will install its own signal handlers for + SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */ + extern int rl_catch_signals; + + /* If non-zero, readline will install a signal handler for SIGWINCH + that also attempts to call any calling application's SIGWINCH signal + handler. Note that the terminal is not cleaned up before the + application's signal handler is called; use rl_cleanup_after_signal() + to do that. */ + extern int rl_catch_sigwinch; + /* Completion variables. */ /* Pointer to the generator function for completion_matches (). *************** *** 347,350 **** --- 539,551 ---- #define rl_symbolic_link_hook rl_directory_completion_hook + /* If non-zero, then this is the address of a function to call when + completing a word would normally display the list of possible matches. + This function is called instead of actually doing the display. + It takes three arguments: (char **matches, int num_matches, int max_length) + where MATCHES is the array of strings that matched, NUM_MATCHES is the + number of strings in that array, and MAX_LENGTH is the length of the + longest string in that array. */ + extern VFunction *rl_completion_display_matches_hook; + /* Non-zero means that the results of the matches are to be treated as filenames. This is ALWAYS zero on entry, and can only be changed *************** *** 412,415 **** --- 613,620 ---- #if !defined (savestring) extern char *savestring (); /* XXX backwards compatibility */ + #endif + + #ifdef __cplusplus + } #endif diff -aNrc2 bash-2.02.1/lib/readline/rlconf.h bash-2.03/lib/readline/rlconf.h *** bash-2.02.1/lib/readline/rlconf.h Sun Feb 26 15:41:49 1995 --- bash-2.03/lib/readline/rlconf.h Fri May 15 09:59:23 1998 *************** *** 57,63 **** /* Define this if you want code that allows readline to be used in an X `callback' style. */ ! #if !defined (SHELL) ! # define READLINE_CALLBACKS ! #endif #endif /* _RLCONF_H_ */ --- 57,61 ---- /* Define this if you want code that allows readline to be used in an X `callback' style. */ ! #define READLINE_CALLBACKS #endif /* _RLCONF_H_ */ diff -aNrc2 bash-2.02.1/lib/readline/rlstdc.h bash-2.03/lib/readline/rlstdc.h *** bash-2.02.1/lib/readline/rlstdc.h Wed Dec 31 19:00:00 1969 --- bash-2.03/lib/readline/rlstdc.h Tue Mar 28 16:04:27 1995 *************** *** 0 **** --- 1,79 ---- + /* stdc.h -- macros to make source compile on both ANSI C and K&R C + compilers. */ + + /* Copyright (C) 1993 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash 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. + + Bash 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. + + You should have received a copy of the GNU General Public License + along with Bash; see the file COPYING. If not, write to the Free + Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + #if !defined (_STDC_H_) + #define _STDC_H_ + + /* Adapted from BSD /usr/include/sys/cdefs.h. */ + + /* A function can be defined using prototypes and compile on both ANSI C + and traditional C compilers with something like this: + extern char *func __P((char *, char *, int)); */ + + #if defined (__STDC__) + + # if !defined (__P) + # define __P(protos) protos + # endif + # define __STRING(x) #x + + # if !defined (__GNUC__) + # define inline + # endif + + #else /* !__STDC__ */ + + # if !defined (__P) + # define __P(protos) () + # endif + # define __STRING(x) "x" + + #if defined (__GNUC__) /* gcc with -traditional */ + # if !defined (const) + # define const __const + # endif + # if !defined (inline) + # define inline __inline + # endif + # if !defined (signed) + # define signed __signed + # endif + # if !defined (volatile) + # define volatile __volatile + # endif + #else /* !__GNUC__ */ + # if !defined (const) + # define const + # endif + # if !defined (inline) + # define inline + # endif + # if !defined (signed) + # define signed + # endif + # if !defined (volatile) + # define volatile + # endif + #endif /* !__GNUC__ */ + + #endif /* !__STDC__ */ + + #endif /* !_STDC_H_ */ diff -aNrc2 bash-2.02.1/lib/readline/rltty.c bash-2.03/lib/readline/rltty.c *** bash-2.02.1/lib/readline/rltty.c Thu Feb 6 09:14:13 1997 --- bash-2.03/lib/readline/rltty.c Wed May 13 17:55:41 1998 *************** *** 38,44 **** #include "rldefs.h" ! #if !defined (SHELL) && defined (GWINSZ_IN_SYS_IOCTL) # include ! #endif /* !SHELL && GWINSZ_IN_SYS_IOCTL */ #include "rltty.h" --- 38,44 ---- #include "rldefs.h" ! #if defined (GWINSZ_IN_SYS_IOCTL) # include ! #endif /* GWINSZ_IN_SYS_IOCTL */ #include "rltty.h" *************** *** 145,149 **** #endif ! #if !defined (SHELL) && defined (TIOCGWINSZ) /* Dummy call to force a backgrounded readline to stop before it tries to get the tty settings. */ --- 145,149 ---- #endif ! #if defined (TIOCGWINSZ) /* Dummy call to force a backgrounded readline to stop before it tries to get the tty settings. */ *************** *** 157,163 **** (void) ioctl (tty, TIOCSWINSZ, &w); } ! #else /* SHELL || !TIOCGWINSZ */ ! # define set_winsize(tty) ! #endif /* SHELL || !TIOCGWINSZ */ #if defined (NEW_TTY_DRIVER) --- 157,161 ---- (void) ioctl (tty, TIOCSWINSZ, &w); } ! #endif /* TIOCGWINSZ */ #if defined (NEW_TTY_DRIVER) *************** *** 390,393 **** --- 388,392 ---- { int ioctl_ret; + set_winsize (tty); diff -aNrc2 bash-2.02.1/lib/readline/savestring.c bash-2.03/lib/readline/savestring.c *** bash-2.02.1/lib/readline/savestring.c Wed Dec 31 19:00:00 1969 --- bash-2.03/lib/readline/savestring.c Thu Dec 31 14:39:49 1998 *************** *** 0 **** --- 1,33 ---- + /* savestring.c */ + + /* Copyright (C) 1998 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library, a library for + reading lines of text with interactive input and history editing. + + The GNU Readline 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 GNU Readline 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. */ + + extern char *strcpy (); + extern char *xmalloc (); + + /* Backwards compatibility, now that savestring has been removed from + all `public' readline header files. */ + char * + savestring (s) + char *s; + { + return ((char *)strcpy (xmalloc (1 + (int)strlen (s)), (s))); + } diff -aNrc2 bash-2.02.1/lib/readline/search.c bash-2.03/lib/readline/search.c *** bash-2.02.1/lib/readline/search.c Thu Mar 6 16:26:16 1997 --- bash-2.03/lib/readline/search.c Mon May 18 10:15:04 1998 *************** *** 62,66 **** extern int _rl_free_history_entry (); extern char *_rl_make_prompt_for_search (); - extern void _rl_restore_prompt (); extern void rl_extend_line_buffer (); --- 62,65 ---- *************** *** 173,177 **** free (p); ! #define SEARCH_RETURN _rl_restore_prompt (); return /* Read the search string. */ --- 172,176 ---- free (p); ! #define SEARCH_RETURN rl_restore_prompt (); return /* Read the search string. */ *************** *** 242,246 **** } ! _rl_restore_prompt (); noninc_dosearch (noninc_search_string, dir); } --- 241,245 ---- } ! rl_restore_prompt (); noninc_dosearch (noninc_search_string, dir); } diff -aNrc2 bash-2.02.1/lib/readline/shell.c bash-2.03/lib/readline/shell.c *** bash-2.02.1/lib/readline/shell.c Tue Feb 3 10:31:56 1998 --- bash-2.03/lib/readline/shell.c Thu May 14 16:35:41 1998 *************** *** 27,34 **** #endif #if defined (HAVE_UNISTD_H) - # ifdef _MINIX - # include - # endif # include #endif /* HAVE_UNISTD_H */ --- 27,33 ---- #endif + #include + #if defined (HAVE_UNISTD_H) # include #endif /* HAVE_UNISTD_H */ *************** *** 46,65 **** #endif /* !HAVE_STRING_H */ ! extern char *xmalloc (), *xrealloc (); ! #if !defined (SHELL) ! #ifdef savestring ! #undef savestring ! #endif ! /* Backwards compatibility, now that savestring has been removed from ! all `public' readline header files. */ ! char * ! savestring (s) ! char *s; ! { ! return ((char *)strcpy (xmalloc (1 + (int)strlen (s)), (s))); ! } /* Does shell-like quoting using single quotes. */ --- 45,58 ---- #endif /* !HAVE_STRING_H */ ! #include ! #if !defined (HAVE_GETPW_DECLS) ! extern struct passwd *getpwuid (); ! #endif /* !HAVE_GETPW_DECLS */ ! extern char *xmalloc (); ! /* All of these functions are resolved from bash if we are linking readline ! as part of bash. */ /* Does shell-like quoting using single quotes. */ *************** *** 127,138 **** } - #else /* SHELL */ - extern char *get_string_value (); - char * ! get_env_value (varname) ! char *varname; { ! return get_string_value (varname); ! } ! #endif /* SHELL */ --- 120,133 ---- } char * ! get_home_dir () { ! char *home_dir; ! struct passwd *entry; ! ! home_dir = (char *)NULL; ! entry = getpwuid (getuid ()); ! if (entry) ! home_dir = entry->pw_dir; ! return (home_dir); ! } diff -aNrc2 bash-2.02.1/lib/readline/signals.c bash-2.03/lib/readline/signals.c *** bash-2.02.1/lib/readline/signals.c Wed Mar 26 13:47:06 1997 --- bash-2.03/lib/readline/signals.c Thu May 14 12:56:26 1998 *************** *** 50,65 **** #include "history.h" - extern int readline_echoing_p; - extern int rl_pending_input; - extern int _rl_meta_flag; - - extern void free_undo_list (); - extern void _rl_get_screen_size (); - extern void _rl_redisplay_after_sigwinch (); - extern void _rl_clean_up_for_exit (); - extern void _rl_kill_kbd_macro (); - extern void _rl_init_argument (); - extern void rl_deprep_terminal (), rl_prep_terminal (); - #if !defined (RETSIGTYPE) # if defined (VOID_SIGHANDLER) --- 50,53 ---- *************** *** 80,85 **** --- 68,99 ---- typedef RETSIGTYPE SigHandler (); + extern int readline_echoing_p; + extern int rl_pending_input; + extern int _rl_meta_flag; + + extern void free_undo_list (); + extern void _rl_get_screen_size (); + extern void _rl_redisplay_after_sigwinch (); + extern void _rl_clean_up_for_exit (); + extern void _rl_kill_kbd_macro (); + extern void _rl_init_argument (); + extern void rl_deprep_terminal (), rl_prep_terminal (); + static SigHandler *rl_set_sighandler (); + /* Exported variables for use by applications. */ + + /* If non-zero, readline will install its own signal handlers for + SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */ + int rl_catch_signals = 1; + + /* If non-zero, readline will install a signal handler for SIGWINCH. */ + #ifdef SIGWINCH + int rl_catch_sigwinch = 1; + #endif + + static int signals_set_flag; + static int sigwinch_set_flag; + /* **************************************************************** */ /* */ *************** *** 88,117 **** /* **************************************************************** */ - /* If we're not being compiled as part of bash, initialize handlers for - and catch the job control signals (SIGTTIN, SIGTTOU, SIGTSTP) and - SIGTERM. */ - #if !defined (SHELL) - # define HANDLE_JOB_SIGNALS - # define HANDLE_SIGTERM - #endif /* !SHELL */ - #if defined (HAVE_POSIX_SIGNALS) typedef struct sigaction sighandler_cxt; # define rl_sigaction(s, nh, oh) sigaction(s, nh, oh) #else ! typedef struct { SigHandler *sa_handler; } sighandler_cxt; # define sigemptyset(m) #endif /* !HAVE_POSIX_SIGNALS */ ! static sighandler_cxt old_int, old_alrm; ! ! #if defined (HANDLE_JOB_SIGNALS) static sighandler_cxt old_tstp, old_ttou, old_ttin; - #endif /* HANDLE_JOB_SIGNALS */ - - #if defined (HANDLE_SIGTERM) - static sighandler_cxt old_term; #endif - #if defined (SIGWINCH) static sighandler_cxt old_winch; --- 102,117 ---- /* **************************************************************** */ #if defined (HAVE_POSIX_SIGNALS) typedef struct sigaction sighandler_cxt; # define rl_sigaction(s, nh, oh) sigaction(s, nh, oh) #else ! typedef struct { SigHandler *sa_handler; int sa_mask, sa_flags; } sighandler_cxt; # define sigemptyset(m) #endif /* !HAVE_POSIX_SIGNALS */ ! static sighandler_cxt old_int, old_term, old_alrm, old_quit; ! #if defined (SIGTSTP) static sighandler_cxt old_tstp, old_ttou, old_ttin; #endif #if defined (SIGWINCH) static sighandler_cxt old_winch; *************** *** 144,159 **** { case SIGINT: ! { ! register HIST_ENTRY *entry; ! ! free_undo_list (); ! ! entry = current_history (); ! if (entry) ! entry->data = (char *)NULL; ! } ! _rl_kill_kbd_macro (); ! rl_clear_message (); ! _rl_init_argument (); #if defined (SIGTSTP) --- 144,149 ---- { case SIGINT: ! rl_free_line_state (); ! /* FALLTHROUGH */ #if defined (SIGTSTP) *************** *** 164,171 **** case SIGALRM: case SIGTERM: ! _rl_clean_up_for_exit (); ! (*rl_deprep_term_function) (); ! rl_clear_signals (); ! rl_pending_input = 0; #if defined (HAVE_POSIX_SIGNALS) --- 154,159 ---- case SIGALRM: case SIGTERM: ! case SIGQUIT: ! rl_cleanup_after_signal (); #if defined (HAVE_POSIX_SIGNALS) *************** *** 189,194 **** #endif /* !HAVE_POSIX_SIGNALS */ ! (*rl_prep_term_function) (_rl_meta_flag); ! rl_set_signals (); } --- 177,181 ---- #endif /* !HAVE_POSIX_SIGNALS */ ! rl_reset_after_signal (); } *************** *** 198,202 **** #if defined (SIGWINCH) static RETSIGTYPE ! rl_handle_sigwinch (sig) int sig; { --- 185,189 ---- #if defined (SIGWINCH) static RETSIGTYPE ! rl_sigwinch_handler (sig) int sig; { *************** *** 210,221 **** because we call the application's SIGWINCH handler after updating our own idea of the screen size. */ ! rl_set_sighandler (SIGWINCH, rl_handle_sigwinch, &dummy_winch); #endif ! if (readline_echoing_p) ! { ! _rl_get_screen_size (fileno (rl_instream), 1); ! _rl_redisplay_after_sigwinch (); ! } /* If another sigwinch handler has been installed, call it. */ --- 197,204 ---- because we call the application's SIGWINCH handler after updating our own idea of the screen size. */ ! rl_set_sighandler (SIGWINCH, rl_sigwinch_handler, &dummy_winch); #endif ! rl_resize_terminal (); /* If another sigwinch handler has been installed, call it. */ *************** *** 264,323 **** } ! int ! rl_set_signals () { sighandler_cxt dummy; SigHandler *oh; - #if defined (HAVE_POSIX_SIGNALS) sigemptyset (&dummy.sa_mask); ! #endif ! ! oh = rl_set_sighandler (SIGINT, rl_signal_handler, &old_int); if (oh == (SigHandler *)SIG_IGN) ! rl_sigaction (SIGINT, &old_int, &dummy); ! oh = rl_set_sighandler (SIGALRM, rl_signal_handler, &old_alrm); ! if (oh == (SigHandler *)SIG_IGN) ! rl_sigaction (SIGALRM, &old_alrm, &dummy); #if defined (HAVE_POSIX_SIGNALS) && defined (SA_RESTART) ! /* If the application using readline has already installed a signal ! handler with SA_RESTART, SIGALRM will cause reads to be restarted ! automatically, so readline should just get out of the way. Since ! we tested for SIG_IGN above, we can just test for SIG_DFL here. */ ! if (oh != (SigHandler *)SIG_DFL && (old_alrm.sa_flags & SA_RESTART)) ! rl_sigaction (SIGALRM, &old_alrm, &dummy); #endif /* HAVE_POSIX_SIGNALS */ - #if defined (HANDLE_JOB_SIGNALS) - #if defined (SIGTSTP) ! oh = rl_set_sighandler (SIGTSTP, rl_signal_handler, &old_tstp); ! if (oh == (SigHandler *)SIG_IGN) ! rl_sigaction (SIGTSTP, &old_tstp, &dummy); ! #else ! oh = (SigHandler *)NULL; #endif /* SIGTSTP */ #if defined (SIGTTOU) ! rl_set_sighandler (SIGTTOU, rl_signal_handler, &old_ttou); ! rl_set_sighandler (SIGTTIN, rl_signal_handler, &old_ttin); ! ! if (oh == (SigHandler *)SIG_IGN) ! { ! rl_set_sighandler (SIGTTOU, SIG_IGN, &dummy); ! rl_set_sighandler (SIGTTIN, SIG_IGN, &dummy); ! } #endif /* SIGTTOU */ ! #endif /* HANDLE_JOB_SIGNALS */ ! #if defined (HANDLE_SIGTERM) ! /* Handle SIGTERM if we're not being compiled as part of bash. */ ! rl_set_sighandler (SIGTERM, rl_signal_handler, &old_term); ! #endif /* HANDLE_SIGTERM */ #if defined (SIGWINCH) ! rl_set_sighandler (SIGWINCH, rl_handle_sigwinch, &old_winch); #endif /* SIGWINCH */ --- 247,310 ---- } ! static void ! rl_maybe_set_sighandler (sig, handler, ohandler) ! int sig; ! SigHandler *handler; ! sighandler_cxt *ohandler; { sighandler_cxt dummy; SigHandler *oh; sigemptyset (&dummy.sa_mask); ! oh = rl_set_sighandler (sig, handler, ohandler); if (oh == (SigHandler *)SIG_IGN) ! rl_sigaction (sig, ohandler, &dummy); ! } ! int ! rl_set_signals () ! { ! sighandler_cxt dummy; ! SigHandler *oh; ! ! if (rl_catch_signals && signals_set_flag == 0) ! { ! rl_maybe_set_sighandler (SIGINT, rl_signal_handler, &old_int); ! rl_maybe_set_sighandler (SIGTERM, rl_signal_handler, &old_term); ! rl_maybe_set_sighandler (SIGQUIT, rl_signal_handler, &old_quit); ! ! oh = rl_set_sighandler (SIGALRM, rl_signal_handler, &old_alrm); ! if (oh == (SigHandler *)SIG_IGN) ! rl_sigaction (SIGALRM, &old_alrm, &dummy); #if defined (HAVE_POSIX_SIGNALS) && defined (SA_RESTART) ! /* If the application using readline has already installed a signal ! handler with SA_RESTART, SIGALRM will cause reads to be restarted ! automatically, so readline should just get out of the way. Since ! we tested for SIG_IGN above, we can just test for SIG_DFL here. */ ! if (oh != (SigHandler *)SIG_DFL && (old_alrm.sa_flags & SA_RESTART)) ! rl_sigaction (SIGALRM, &old_alrm, &dummy); #endif /* HAVE_POSIX_SIGNALS */ #if defined (SIGTSTP) ! rl_maybe_set_sighandler (SIGTSTP, rl_signal_handler, &old_tstp); #endif /* SIGTSTP */ #if defined (SIGTTOU) ! rl_maybe_set_sighandler (SIGTTOU, rl_signal_handler, &old_ttou); #endif /* SIGTTOU */ ! #if defined (SIGTTIN) ! rl_maybe_set_sighandler (SIGTTIN, rl_signal_handler, &old_ttin); ! #endif /* SIGTTIN */ ! signals_set_flag = 1; ! } #if defined (SIGWINCH) ! if (rl_catch_sigwinch && sigwinch_set_flag == 0) ! { ! rl_maybe_set_sighandler (SIGWINCH, rl_sigwinch_handler, &old_winch); ! sigwinch_set_flag = 1; ! } #endif /* SIGWINCH */ *************** *** 330,363 **** sighandler_cxt dummy; ! #if defined (HAVE_POSIX_SIGNALS) ! sigemptyset (&dummy.sa_mask); ! #endif ! ! rl_sigaction (SIGINT, &old_int, &dummy); ! rl_sigaction (SIGALRM, &old_alrm, &dummy); ! #if defined (HANDLE_JOB_SIGNALS) #if defined (SIGTSTP) ! rl_sigaction (SIGTSTP, &old_tstp, &dummy); ! #endif #if defined (SIGTTOU) ! rl_sigaction (SIGTTOU, &old_ttou, &dummy); ! rl_sigaction (SIGTTIN, &old_ttin, &dummy); #endif /* SIGTTOU */ ! #endif /* HANDLE_JOB_SIGNALS */ ! #if defined (HANDLE_SIGTERM) ! rl_sigaction (SIGTERM, &old_term, &dummy); ! #endif /* HANDLE_SIGTERM */ #if defined (SIGWINCH) ! sigemptyset (&dummy.sa_mask); ! rl_sigaction (SIGWINCH, &old_winch, &dummy); #endif return 0; } #endif /* HANDLE_SIGNALS */ --- 317,394 ---- sighandler_cxt dummy; ! if (rl_catch_signals && signals_set_flag == 1) ! { ! sigemptyset (&dummy.sa_mask); ! rl_sigaction (SIGINT, &old_int, &dummy); ! rl_sigaction (SIGTERM, &old_term, &dummy); ! rl_sigaction (SIGQUIT, &old_quit, &dummy); ! rl_sigaction (SIGALRM, &old_alrm, &dummy); #if defined (SIGTSTP) ! rl_sigaction (SIGTSTP, &old_tstp, &dummy); ! #endif /* SIGTSTP */ #if defined (SIGTTOU) ! rl_sigaction (SIGTTOU, &old_ttou, &dummy); #endif /* SIGTTOU */ ! #if defined (SIGTTIN) ! rl_sigaction (SIGTTIN, &old_ttin, &dummy); ! #endif /* SIGTTIN */ ! signals_set_flag = 0; ! } #if defined (SIGWINCH) ! if (rl_catch_sigwinch && sigwinch_set_flag == 1) ! { ! sigemptyset (&dummy.sa_mask); ! rl_sigaction (SIGWINCH, &old_winch, &dummy); ! sigwinch_set_flag = 0; ! } #endif return 0; } + + /* Clean up the terminal and readline state after catching a signal, before + resending it to the calling application. */ + void + rl_cleanup_after_signal () + { + _rl_clean_up_for_exit (); + (*rl_deprep_term_function) (); + rl_clear_signals (); + rl_pending_input = 0; + } + + /* Reset the terminal and readline state after a signal handler returns. */ + void + rl_reset_after_signal () + { + (*rl_prep_term_function) (_rl_meta_flag); + rl_set_signals (); + } + + /* Free up the readline variable line state for the current line (undo list, + any partial history entry, any keyboard macros in progress, and any + numeric arguments in process) after catching a signal, before calling + rl_cleanup_after_signal(). */ + void + rl_free_line_state () + { + register HIST_ENTRY *entry; + + free_undo_list (); + + entry = current_history (); + if (entry) + entry->data = (char *)NULL; + + _rl_kill_kbd_macro (); + rl_clear_message (); + _rl_init_argument (); + } + #endif /* HANDLE_SIGNALS */ diff -aNrc2 bash-2.02.1/lib/readline/terminal.c bash-2.03/lib/readline/terminal.c *** bash-2.02.1/lib/readline/terminal.c Fri Jul 18 17:08:00 1997 --- bash-2.03/lib/readline/terminal.c Thu May 14 10:54:16 1998 *************** *** 233,236 **** --- 233,246 ---- } + void + rl_resize_terminal () + { + if (readline_echoing_p) + { + _rl_get_screen_size (fileno (rl_instream), 1); + _rl_redisplay_after_sigwinch (); + } + } + struct _tc_string { char *tc_var; diff -aNrc2 bash-2.02.1/lib/readline/tilde.c bash-2.03/lib/readline/tilde.c *** bash-2.02.1/lib/readline/tilde.c Fri Jul 18 17:08:41 1997 --- bash-2.03/lib/readline/tilde.c Thu May 14 15:47:28 1998 *************** *** 48,55 **** #include "tilde.h" - #ifdef SHELL - #include "shell.h" - #endif - #if !defined (HAVE_GETPW_DECLS) extern struct passwd *getpwuid (), *getpwnam (); --- 48,51 ---- *************** *** 78,81 **** --- 74,83 ---- #endif /* TEST || STATIC_MALLOC */ + /* If being compiled as part of bash, these will be satisfied from + variables.o. If being compiled as part of readline, they will + be satisfied from shell.o. */ + extern char *get_home_dir (); + extern char *get_env_value (); + /* The default value of tilde_additional_prefixes. This is set to whitespace preceding a tilde so that simple programs which do not *************** *** 172,184 **** } - #if !defined (SHELL) - static char * - get_string_value (varname) - char *varname; - { - return ((char *)getenv (varname)); - } - #endif - /* Return a new string which is the result of tilde expanding STRING. */ char * --- 174,177 ---- *************** *** 285,309 **** } - static char * - get_home_dir () - { - char *home_dir; - - #ifdef SHELL - home_dir = (char *)NULL; - if (current_user.home_dir == 0) - get_current_user_info (); - home_dir = current_user.home_dir; - #else - struct passwd *entry; - - home_dir = (char *)NULL; - entry = getpwuid (getuid ()); - if (entry) - home_dir = entry->pw_dir; - #endif - return (home_dir); - } - /* Do the work of tilde expansion on FILENAME. FILENAME starts with a tilde. If there is no expansion, call tilde_expansion_failure_hook. --- 278,281 ---- *************** *** 329,333 **** { /* Prefix $HOME to the rest of the string. */ ! expansion = get_string_value ("HOME"); /* If there is no HOME variable, look up the directory in --- 301,305 ---- { /* Prefix $HOME to the rest of the string. */ ! expansion = get_env_value ("HOME"); /* If there is no HOME variable, look up the directory in diff -aNrc2 bash-2.02.1/lib/readline/util.c bash-2.03/lib/readline/util.c *** bash-2.02.1/lib/readline/util.c Fri Oct 3 11:12:47 1997 --- bash-2.03/lib/readline/util.c Mon Jun 8 15:47:06 1998 *************** *** 65,68 **** --- 65,69 ---- /* Pseudo-global functions imported from other library files. */ + extern void _rl_replace_text (); extern void _rl_pop_executing_macro (); extern void _rl_set_the_line (); *************** *** 125,129 **** #if defined (TIOCSTAT) ioctl (1, TIOCSTAT, (char *)0); ! rl_refresh_line (); #else ding (); --- 126,130 ---- #if defined (TIOCSTAT) ioctl (1, TIOCSTAT, (char *)0); ! rl_refresh_line (count, key); #else ding (); diff -aNrc2 bash-2.02.1/lib/readline/vi_mode.c bash-2.03/lib/readline/vi_mode.c *** bash-2.02.1/lib/readline/vi_mode.c Tue Mar 17 10:41:27 1998 --- bash-2.03/lib/readline/vi_mode.c Mon Jun 8 15:48:00 1998 *************** *** 78,82 **** /* Variables imported from readline.c */ ! extern int rl_point, rl_end, rl_mark, rl_done; extern FILE *rl_instream; extern int rl_line_buffer_len, rl_explicit_arg, rl_numeric_arg; --- 78,82 ---- /* Variables imported from readline.c */ ! extern int rl_point, rl_end, rl_mark; extern FILE *rl_instream; extern int rl_line_buffer_len, rl_explicit_arg, rl_numeric_arg; *************** *** 353,359 **** if (_rl_uppercase_p (key)) ! rl_vi_bWord (count); else ! rl_vi_bword (count); return (0); --- 353,359 ---- if (_rl_uppercase_p (key)) ! rl_vi_bWord (count, key); else ! rl_vi_bword (count, key); return (0); *************** *** 375,381 **** if (_rl_uppercase_p (key)) ! rl_vi_fWord (count); else ! rl_vi_fword (count); return (0); } --- 375,381 ---- if (_rl_uppercase_p (key)) ! rl_vi_fWord (count, key); else ! rl_vi_fword (count, key); return (0); } *************** *** 393,399 **** if (_rl_uppercase_p (key)) ! rl_vi_eWord (count); else ! rl_vi_eword (count); return (0); } --- 393,399 ---- if (_rl_uppercase_p (key)) ! rl_vi_eWord (count, key); else ! rl_vi_eword (count, key); return (0); } *************** *** 401,406 **** /* Move forward a word the way that 'W' does. */ int ! rl_vi_fWord (count) ! int count; { while (count-- && rl_point < (rl_end - 1)) --- 401,406 ---- /* Move forward a word the way that 'W' does. */ int ! rl_vi_fWord (count, ignore) ! int count, ignore; { while (count-- && rl_point < (rl_end - 1)) *************** *** 418,423 **** int ! rl_vi_bWord (count) ! int count; { while (count-- && rl_point > 0) --- 418,423 ---- int ! rl_vi_bWord (count, ignore) ! int count, ignore; { while (count-- && rl_point > 0) *************** *** 442,447 **** int ! rl_vi_eWord (count) ! int count; { while (count-- && rl_point < (rl_end - 1)) --- 442,447 ---- int ! rl_vi_eWord (count, ignore) ! int count, ignore; { while (count-- && rl_point < (rl_end - 1)) *************** *** 472,477 **** int ! rl_vi_fword (count) ! int count; { while (count-- && rl_point < (rl_end - 1)) --- 472,477 ---- int ! rl_vi_fword (count, ignore) ! int count, ignore; { while (count-- && rl_point < (rl_end - 1)) *************** *** 498,503 **** int ! rl_vi_bword (count) ! int count; { while (count-- && rl_point > 0) --- 498,503 ---- int ! rl_vi_bword (count, ignore) ! int count, ignore; { while (count-- && rl_point > 0) *************** *** 537,542 **** int ! rl_vi_eword (count) ! int count; { while (count-- && rl_point < rl_end - 1) --- 537,542 ---- int ! rl_vi_eword (count, ignore) ! int count, ignore; { while (count-- && rl_point < rl_end - 1) *************** *** 730,734 **** rl_point++; ! rl_yank (); rl_backward (1, key); return (0); --- 730,734 ---- rl_point++; ! rl_yank (1, key); rl_backward (1, key); return (0); diff -aNrc2 bash-2.02.1/lib/sh/Makefile.in bash-2.03/lib/sh/Makefile.in *** bash-2.02.1/lib/sh/Makefile.in Tue Feb 24 16:11:48 1998 --- bash-2.03/lib/sh/Makefile.in Thu Feb 18 12:13:57 1999 *************** *** 17,24 **** --- 17,27 ---- RANLIB = @RANLIB@ AR = @AR@ + ARFLAGS = @ARFLAGS@ RM = rm -f CP = cp MV = mv + SHELL = @MAKE_SHELL@ + CFLAGS = @CFLAGS@ LOCAL_CFLAGS = @LOCAL_CFLAGS@ *************** *** 45,49 **** CSOURCES = clktck.c getcwd.c getenv.c oslib.c setlinebuf.c \ strcasecmp.c strerror.c strtod.c strtol.c strtoul.c \ ! vprint.c itos.c # The header files for this library. --- 48,52 ---- CSOURCES = clktck.c getcwd.c getenv.c oslib.c setlinebuf.c \ strcasecmp.c strerror.c strtod.c strtol.c strtoul.c \ ! vprint.c itos.c rename.c # The header files for this library. *************** *** 53,57 **** OBJECTS = clktck.o getcwd.o getenv.o oslib.o setlinebuf.o \ strcasecmp.o strerror.o strtod.o strtol.o strtoul.o \ ! vprint.o itos.o SUPPORT = Makefile --- 56,60 ---- OBJECTS = clktck.o getcwd.o getenv.o oslib.o setlinebuf.o \ strcasecmp.o strerror.o strtod.o strtol.o strtoul.o \ ! vprint.o itos.o rename.o SUPPORT = Makefile *************** *** 61,65 **** $(LIBRARY_NAME): $(OBJECTS) $(RM) $@ ! $(AR) cr $@ $(OBJECTS) -test -n "$(RANLIB)" && $(RANLIB) $@ --- 64,68 ---- $(LIBRARY_NAME): $(OBJECTS) $(RM) $@ ! $(AR) $(ARFLAGS) $@ $(OBJECTS) -test -n "$(RANLIB)" && $(RANLIB) $@ *************** *** 87,90 **** --- 90,94 ---- itos.o: itos.c oslib.o: oslib.c + rename.o: rename.c setlinebuf.o: setlinebuf.c strcasecmp.o: strcasecmp.c *************** *** 101,104 **** --- 105,109 ---- itos.o: ${BUILD_DIR}/config.h oslib.o: ${BUILD_DIR}/config.h + rename.o: ${BUILD_DIR}/config.h setlinebuf.o: ${BUILD_DIR}/config.h strcasecmp.o: ${BUILD_DIR}/config.h *************** *** 143,146 **** --- 148,153 ---- oslib.o: ${POSIX_INC}/posixstat.h ${POSIX_INC}/filecntl.h oslib.o: ${POSIX_INC}/ansi_stdlib.h + + rename.o: ${topdir}/bashtypes.h ${topdir}/stdc.h strcasecmp.o: ${topdir}/stdc.h ${topdir}/bashansi.h ${topdir}/ansi_stdlib.h diff -aNrc2 bash-2.02.1/lib/sh/itos.c bash-2.03/lib/sh/itos.c *** bash-2.02.1/lib/sh/itos.c Tue Feb 24 15:46:04 1998 --- bash-2.03/lib/sh/itos.c Fri Aug 7 12:31:47 1998 *************** *** 32,42 **** #define MAX_INT_LEN 32 ! /* Integer to string conversion. This conses the string; the ! caller should free it. */ char * ! itos (i) int i; { ! char buf[MAX_INT_LEN], *p, *ret; int negative = 0; unsigned int ui; --- 32,45 ---- #define MAX_INT_LEN 32 ! /* Integer to string conversion. The caller passes the buffer and ! the size. This should check for buffer underflow, but currently ! does not. */ char * ! inttostr (i, buf, len) int i; + char *buf; + int len; { ! char *p; int negative = 0; unsigned int ui; *************** *** 50,54 **** ui = (unsigned int) i; ! p = buf + MAX_INT_LEN - 2; p[1] = '\0'; --- 53,57 ---- ui = (unsigned int) i; ! p = buf + len - 2; p[1] = '\0'; *************** *** 60,64 **** *p-- = '-'; ! ret = savestring (p + 1); ! return (ret); } --- 63,78 ---- *p-- = '-'; ! return (p + 1); ! } ! ! /* Integer to string conversion. This conses the string; the ! caller should free it. */ ! char * ! itos (i) ! int i; ! { ! char *p, lbuf[MAX_INT_LEN]; ! ! p = inttostr (i, lbuf, sizeof(lbuf)); ! return (savestring (p)); } diff -aNrc2 bash-2.02.1/lib/sh/oslib.c bash-2.03/lib/sh/oslib.c *** bash-2.02.1/lib/sh/oslib.c Fri Oct 10 13:07:14 1997 --- bash-2.03/lib/sh/oslib.c Tue Aug 25 11:37:00 1998 *************** *** 155,158 **** --- 155,161 ---- #if !defined (HAVE_BCOPY) + # if defined (bcopy) + # undef bcopy + # endif void bcopy (s,d,n) *************** *** 165,168 **** --- 168,174 ---- #if !defined (HAVE_BZERO) + # if defined (bzero) + # undef bzero + # endif void bzero (s, n) diff -aNrc2 bash-2.02.1/lib/sh/rename.c bash-2.03/lib/sh/rename.c *** bash-2.02.1/lib/sh/rename.c Wed Dec 31 19:00:00 1969 --- bash-2.03/lib/sh/rename.c Fri Sep 18 17:10:17 1998 *************** *** 0 **** --- 1,27 ---- + /* + * rename - rename a file + */ + + #include + + #if !defined (HAVE_RENAME) + + #include + + #if defined (HAVE_UNISTD_H) + # include + #endif + + #include + + int + rename (from, to) + const char *from, *to; + { + unlink (to); + if (link (from, to) < 0) + return (-1); + unlink (from); + return (0); + } + #endif /* !HAVE_RENAME */ diff -aNrc2 bash-2.02.1/lib/sh/strtol.c bash-2.03/lib/sh/strtol.c *** bash-2.02.1/lib/sh/strtol.c Thu Oct 9 11:37:20 1997 --- bash-2.03/lib/sh/strtol.c Thu Aug 13 12:23:01 1998 *************** *** 35,38 **** --- 35,39 ---- #endif + #include #include diff -aNrc2 bash-2.02.1/lib/termcap/Makefile.in bash-2.03/lib/termcap/Makefile.in *** bash-2.02.1/lib/termcap/Makefile.in Mon Feb 26 15:33:04 1996 --- bash-2.03/lib/termcap/Makefile.in Thu Feb 18 12:14:31 1999 *************** *** 17,24 **** --- 17,27 ---- RANLIB = @RANLIB@ AR = @AR@ + ARFLAGS = @ARFLAGS@ RM = rm -f CP = cp MV = mv + SHELL = @MAKE_SHELL@ + CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ *************** *** 36,41 **** $(CC) -c $(CCFLAGS) $< - SHELL = /bin/sh - SOURCES = termcap.c tparam.c OBJECTS = termcap.o tparam.o --- 39,42 ---- *************** *** 51,55 **** libtermcap.a: $(OBJECTS) $(RM) -f $@ ! $(AR) cr $@ $(OBJECTS) -test -n "$(RANLIB)" && $(RANLIB) $@ --- 52,56 ---- libtermcap.a: $(OBJECTS) $(RM) -f $@ ! $(AR) $(ARFLAGS) $@ $(OBJECTS) -test -n "$(RANLIB)" && $(RANLIB) $@ diff -aNrc2 bash-2.02.1/lib/tilde/Makefile.in bash-2.03/lib/tilde/Makefile.in *** bash-2.02.1/lib/tilde/Makefile.in Tue Sep 16 13:14:16 1997 --- bash-2.03/lib/tilde/Makefile.in Thu Feb 18 12:14:52 1999 *************** *** 17,24 **** --- 17,27 ---- RANLIB = @RANLIB@ AR = @AR@ + ARFLAGS = @ARFLAGS@ RM = rm CP = cp MV = mv + SHELL = @MAKE_SHELL@ + CFLAGS = @CFLAGS@ LOCAL_CFLAGS = @LOCAL_CFLAGS@ *************** *** 65,69 **** $(LIBRARY_NAME): $(OBJECTS) $(RM) -f $@ ! $(AR) cr $@ $(OBJECTS) -test -n "$(RANLIB)" && $(RANLIB) $@ --- 68,72 ---- $(LIBRARY_NAME): $(OBJECTS) $(RM) -f $@ ! $(AR) $(ARFLAGS) $@ $(OBJECTS) -test -n "$(RANLIB)" && $(RANLIB) $@ diff -aNrc2 bash-2.02.1/lib/tilde/README bash-2.03/lib/tilde/README *** bash-2.02.1/lib/tilde/README Wed Dec 31 19:00:00 1969 --- bash-2.03/lib/tilde/README Thu May 14 16:17:02 1998 *************** *** 0 **** --- 1,5 ---- + If you're building this separately from bash or the readline library, add + $(srcdir)/shell.c to the CSOURCES variable and shell.o to the OBJECTS + variable in Makefile.in. (Not that this is very useful without readline + or bash.) + diff -aNrc2 bash-2.02.1/lib/tilde/shell.c bash-2.03/lib/tilde/shell.c *** bash-2.02.1/lib/tilde/shell.c Wed Dec 31 19:00:00 1969 --- bash-2.03/lib/tilde/shell.c Thu May 14 15:39:19 1998 *************** *** 0 **** --- 1,70 ---- + /* shell.c -- tilde utility functions that are normally provided by + bash when readline is linked as part of the shell. */ + + /* Copyright (C) 1998 Free Software Foundation, Inc. + + This file is part of the GNU Tilde Library. + + The GNU Tilde 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 GNU Tilde 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. */ + + #if defined (HAVE_CONFIG_H) + # include + #endif + + #if defined (HAVE_UNISTD_H) + # ifdef _MINIX + # include + # endif + # include + #endif /* HAVE_UNISTD_H */ + + #if defined (HAVE_STDLIB_H) + # include + #else + # include "ansi_stdlib.h" + #endif /* HAVE_STDLIB_H */ + + #if defined (HAVE_STRING_H) + # include + #else + # include + #endif /* !HAVE_STRING_H */ + + #include + + #if !defined (HAVE_GETPW_DECLS) + extern struct passwd *getpwuid (); + #endif /* !HAVE_GETPW_DECLS */ + + char * + get_env_value (varname) + char *varname; + { + return ((char *)getenv (varname)); + } + + char * + get_home_dir () + { + char *home_dir; + struct passwd *entry; + + home_dir = (char *)NULL; + entry = getpwuid (getuid ()); + if (entry) + home_dir = entry->pw_dir; + return (home_dir); + } diff -aNrc2 bash-2.02.1/lib/tilde/tilde.c bash-2.03/lib/tilde/tilde.c *** bash-2.02.1/lib/tilde/tilde.c Fri Jul 18 17:08:41 1997 --- bash-2.03/lib/tilde/tilde.c Thu May 14 15:47:28 1998 *************** *** 48,55 **** #include "tilde.h" - #ifdef SHELL - #include "shell.h" - #endif - #if !defined (HAVE_GETPW_DECLS) extern struct passwd *getpwuid (), *getpwnam (); --- 48,51 ---- *************** *** 78,81 **** --- 74,83 ---- #endif /* TEST || STATIC_MALLOC */ + /* If being compiled as part of bash, these will be satisfied from + variables.o. If being compiled as part of readline, they will + be satisfied from shell.o. */ + extern char *get_home_dir (); + extern char *get_env_value (); + /* The default value of tilde_additional_prefixes. This is set to whitespace preceding a tilde so that simple programs which do not *************** *** 172,184 **** } - #if !defined (SHELL) - static char * - get_string_value (varname) - char *varname; - { - return ((char *)getenv (varname)); - } - #endif - /* Return a new string which is the result of tilde expanding STRING. */ char * --- 174,177 ---- *************** *** 285,309 **** } - static char * - get_home_dir () - { - char *home_dir; - - #ifdef SHELL - home_dir = (char *)NULL; - if (current_user.home_dir == 0) - get_current_user_info (); - home_dir = current_user.home_dir; - #else - struct passwd *entry; - - home_dir = (char *)NULL; - entry = getpwuid (getuid ()); - if (entry) - home_dir = entry->pw_dir; - #endif - return (home_dir); - } - /* Do the work of tilde expansion on FILENAME. FILENAME starts with a tilde. If there is no expansion, call tilde_expansion_failure_hook. --- 278,281 ---- *************** *** 329,333 **** { /* Prefix $HOME to the rest of the string. */ ! expansion = get_string_value ("HOME"); /* If there is no HOME variable, look up the directory in --- 301,305 ---- { /* Prefix $HOME to the rest of the string. */ ! expansion = get_env_value ("HOME"); /* If there is no HOME variable, look up the directory in diff -aNrc2 bash-2.02.1/locale.c bash-2.03/locale.c *** bash-2.02.1/locale.c Mon Jul 7 16:48:42 1997 --- bash-2.03/locale.c Wed Oct 14 13:08:02 1998 *************** *** 168,178 **** --- 168,187 ---- } + #if 0 /* Called when LANG is assigned a value. Sets LC_ALL if that has not already been set. */ + #else + /* This no longer does anything; we rely on the C library for correct + behavior. */ + #endif int set_lang (var, value) char *var, *value; { + #if 0 return ((lc_all == 0) ? set_locale_var ("LC_ALL", value) : 0); + #else + return 0; + #endif } diff -aNrc2 bash-2.02.1/make_cmd.c bash-2.03/make_cmd.c *** bash-2.02.1/make_cmd.c Tue Jun 30 12:09:08 1998 --- bash-2.03/make_cmd.c Tue Jan 12 12:45:36 1999 *************** *** 347,350 **** --- 347,351 ---- command->redirects = (REDIRECT *)NULL; command->flags = 0; + command->line = cond_node ? cond_node->line : 0; return (command); *************** *** 596,600 **** { if (command->type != cm_simple) ! programming_error ("clean_simple_command: bad command type `%d'", command->type); else { --- 597,601 ---- { if (command->type != cm_simple) ! command_error ("clean_simple_command", CMDERR_BADTYPE, command->type, 0); else { diff -aNrc2 bash-2.02.1/memalloc.h bash-2.03/memalloc.h *** bash-2.02.1/memalloc.h Tue Jan 14 16:13:50 1997 --- bash-2.03/memalloc.h Tue Aug 25 11:19:15 1998 *************** *** 35,43 **** #endif /* HAVE_ALLOCA_H && !HAVE_ALLOCA */ ! #if defined (__GNUC__) # undef alloca # define alloca __builtin_alloca ! #else /* !__GNUC__ */ ! # if defined (HAVE_ALLOCA_H) # if defined (IBMESA) # include --- 35,43 ---- #endif /* HAVE_ALLOCA_H && !HAVE_ALLOCA */ ! #if defined (__GNUC__) && !defined (C_ALLOCA) # undef alloca # define alloca __builtin_alloca ! #else /* !__GNUC__ || C_ALLOCA */ ! # if defined (HAVE_ALLOCA_H) && !defined (C_ALLOCA) # if defined (IBMESA) # include *************** *** 45,49 **** # include # endif /* !IBMESA */ ! # else /* !HAVE_ALLOCA_H */ # if defined (__hpux) && defined (__STDC__) && !defined (alloca) extern void *alloca (); --- 45,49 ---- # include # endif /* !IBMESA */ ! # else /* !HAVE_ALLOCA_H || C_ALLOCA */ # if defined (__hpux) && defined (__STDC__) && !defined (alloca) extern void *alloca (); *************** *** 53,58 **** # endif /* !alloca */ # endif /* !__hpux || !__STDC__ && !alloca */ ! # endif /* !HAVE_ALLOCA_H */ ! #endif /* !__GNUC__ */ #endif /* _MEMALLOC_H_ */ --- 53,58 ---- # endif /* !alloca */ # endif /* !__hpux || !__STDC__ && !alloca */ ! # endif /* !HAVE_ALLOCA_H || C_ALLOCA */ ! #endif /* !__GNUC__ || C_ALLOCA */ #endif /* _MEMALLOC_H_ */ diff -aNrc2 bash-2.02.1/nojobs.c bash-2.03/nojobs.c *** bash-2.02.1/nojobs.c Wed Jul 30 13:44:51 1997 --- bash-2.03/nojobs.c Tue Sep 15 12:42:01 1998 *************** *** 669,672 **** --- 669,673 ---- /* Make the current tty use the state in shell_tty_info. */ + int set_tty_state () { *************** *** 677,681 **** { if (got_tty_state == 0) ! return; #if defined (TERMIOS_TTY_DRIVER) --- 678,682 ---- { if (got_tty_state == 0) ! return 0; #if defined (TERMIOS_TTY_DRIVER) *************** *** 689,692 **** --- 690,694 ---- #endif } + return 0; } diff -aNrc2 bash-2.02.1/parse.y bash-2.03/parse.y *** bash-2.02.1/parse.y Wed Mar 25 12:16:23 1998 --- bash-2.03/parse.y Thu Feb 18 10:35:57 1999 *************** *** 787,795 **** /* Shell meta-characters that, when unquoted, separate words. */ ! #define shellmeta(c) (strchr ("()<>;&|", (c)) != 0) ! #define shellbreak(c) (strchr ("()<>;&| \t\n", (c)) != 0) #define shellquote(c) ((c) == '"' || (c) == '`' || (c) == '\'') #define shellexp(c) ((c) == '$' || (c) == '<' || (c) == '>') /* The token currently being read. */ static int current_token; --- 787,798 ---- /* Shell meta-characters that, when unquoted, separate words. */ ! #define shellmeta(c) (strchr (shell_meta_chars, (c)) != 0) ! #define shellbreak(c) (strchr (shell_break_chars, (c)) != 0) #define shellquote(c) ((c) == '"' || (c) == '`' || (c) == '\'') #define shellexp(c) ((c) == '$' || (c) == '<' || (c) == '>') + char *shell_meta_chars = "()<>;&|"; + char *shell_break_chars = "()<>;&| \t\n"; + /* The token currently being read. */ static int current_token; *************** *** 1468,1471 **** --- 1471,1478 ---- }; + /* XXX - we should also have an alist with strings for other tokens, so we + can give more descriptive error messages. Look at y.tab.h for the + other tokens. */ + /* These are used by read_token_word, but appear up here so that shell_getc can use them to decide when to add otherwise blank lines to the history. */ *************** *** 1920,1923 **** --- 1927,1935 ---- case OR_OR: case '&': + case DO: + case THEN: + case ELSE: + case '{': + case '(': return 1; default: *************** *** 2023,2027 **** #if defined (COMMAND_TIMING) ! if (STREQ (token, "time") && time_command_acceptable ()) return (TIME); #endif /* COMMAND_TIMING */ --- 2035,2039 ---- #if defined (COMMAND_TIMING) ! if (STREQ (token, "time") && ((parser_state & PST_CASEPAT) == 0) && time_command_acceptable ()) return (TIME); #endif /* COMMAND_TIMING */ *************** *** 2289,2292 **** --- 2301,2307 ---- reprompting the user, if necessary, after reading a newline, and returning correct error values if it reads EOF. */ + + #define P_FIRSTCLOSE 0x01 + static char matched_pair_error; static char * *************** *** 2348,2352 **** else if (ch == close) /* ending delimiter */ count--; ! else if (ch == open) /* nested begin */ count++; --- 2363,2367 ---- else if (ch == close) /* ending delimiter */ count--; ! else if (((flags & P_FIRSTCLOSE) == 0) && ch == open) /* nested begin */ count++; *************** *** 2410,2414 **** nestret = parse_matched_pair (0, '(', ')', &nestlen, 0); else if (ch == '{') /* } */ ! nestret = parse_matched_pair (0, '{', '}', &nestlen, 0); else if (ch == '[') /* ] */ nestret = parse_matched_pair (0, '[', ']', &nestlen, 0); --- 2425,2429 ---- nestret = parse_matched_pair (0, '(', ')', &nestlen, 0); else if (ch == '{') /* } */ ! nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE); else if (ch == '[') /* ] */ nestret = parse_matched_pair (0, '[', ']', &nestlen, 0); *************** *** 2788,2792 **** { if (peek_char == '{') /* } */ ! ttok = parse_matched_pair (cd, '{', '}', &ttoklen, 0); else if (peek_char == '(') /* ) */ { --- 2803,2807 ---- { if (peek_char == '{') /* } */ ! ttok = parse_matched_pair (cd, '{', '}', &ttoklen, P_FIRSTCLOSE); else if (peek_char == '(') /* ) */ { *************** *** 2842,2845 **** --- 2857,2877 ---- goto next_character; } + /* This could eventually be extended to recognize all of the + shell's single-character parameter expansions, and set flags.*/ + else if (character == '$' && peek_char == '$') + { + ttok = xmalloc (3); + ttok[0] = ttok[1] = '$'; + ttok[2] = '\0'; + RESIZE_MALLOCED_BUFFER (token, token_index, 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + strcpy (token + token_index, ttok); + token_index += 2; + dollar_present = 1; + all_digits = 0; + FREE (ttok); + goto next_character; + } else shell_ungetc (peek_char); *************** *** 2856,2859 **** --- 2888,2896 ---- if (ttok == &matched_pair_error) return -1; /* Bail immediately. */ + if (ttok[0] == '(') /* ) */ + { + FREE (ttok); + return -1; + } RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, token_buffer_size, *************** *** 3474,3480 **** case '$': ! temp = xmalloc (2); ! temp[0] = current_user.euid == 0 ? '#' : '$'; ! temp[1] = '\0'; goto add_string; --- 3511,3519 ---- case '$': ! t = temp = xmalloc (3); ! if ((promptvars || posixly_correct) && (current_user.euid != 0)) ! *t++ = '\\'; ! *t++ = current_user.euid == 0 ? '#' : '$'; ! *t = '\0'; goto add_string; diff -aNrc2 bash-2.02.1/pathexp.c bash-2.03/pathexp.c *** bash-2.02.1/pathexp.c Fri Jan 30 13:15:21 1998 --- bash-2.03/pathexp.c Thu Feb 18 11:10:34 1999 *************** *** 35,39 **** #include ! #include /* Control whether * matches .files in globbing. */ --- 35,44 ---- #include ! ! #if defined (USE_POSIX_GLOB_LIBRARY) ! # include ! #else ! # include ! #endif /* Control whether * matches .files in globbing. */ *************** *** 173,177 **** --- 178,187 ---- filenames.gl_offs = 0; + # if defined (GLOB_PERIOD) glob_flags = glob_dot_filenames ? GLOB_PERIOD : 0; + # else + glob_flags = 0; + # endif /* !GLOB_PERIOD */ + glob_flags |= (GLOB_ERR | GLOB_DOOFFS); *************** *** 182,187 **** if (i == GLOB_NOSPACE || i == GLOB_ABEND) return ((char **)NULL); ! ! if (i == GLOB_NOMATCH) filenames.gl_pathv = (char **)NULL; --- 192,198 ---- if (i == GLOB_NOSPACE || i == GLOB_ABEND) return ((char **)NULL); ! else if (i == GLOB_NOMATCH) ! filenames.gl_pathv = (char **)NULL; ! else if (i != 0) /* other error codes not in POSIX.2 */ filenames.gl_pathv = (char **)NULL; diff -aNrc2 bash-2.02.1/posixjmp.h bash-2.03/posixjmp.h *** bash-2.02.1/posixjmp.h Thu Jan 16 13:54:33 1997 --- bash-2.03/posixjmp.h Thu Feb 18 12:34:51 1999 *************** *** 10,17 **** #if defined (HAVE_POSIX_SIGSETJMP) # define procenv_t sigjmp_buf ! # undef setjmp ! # define setjmp(x) sigsetjmp((x), 1) ! # undef longjmp ! # define longjmp(x, n) siglongjmp((x), (n)) #else # define procenv_t jmp_buf --- 10,19 ---- #if defined (HAVE_POSIX_SIGSETJMP) # define procenv_t sigjmp_buf ! # if !defined (__OPENNT) ! # undef setjmp ! # define setjmp(x) sigsetjmp((x), 1) ! # undef longjmp ! # define longjmp(x, n) siglongjmp((x), (n)) ! # endif /* !__OPENNT */ #else # define procenv_t jmp_buf diff -aNrc2 bash-2.02.1/print_cmd.c bash-2.03/print_cmd.c *** bash-2.02.1/print_cmd.c Mon Nov 10 14:39:01 1997 --- bash-2.03/print_cmd.c Tue Jan 12 12:46:19 1999 *************** *** 261,265 **** default: ! programming_error ("print_command: bad command type `%d'", command->type); break; } --- 261,265 ---- default: ! command_error ("print_command", CMDERR_BADTYPE, command->type, 0); break; } *************** *** 269,273 **** if (command->redirects) ! print_redirection_list (command->redirects); } } --- 269,276 ---- if (command->redirects) ! { ! cprintf (" "); ! print_redirection_list (command->redirects); ! } } } *************** *** 519,523 **** else if (cond->type == COND_UNARY) { ! cprintf (cond->op->word); cprintf (" "); print_cond_node (cond->left); --- 522,526 ---- else if (cond->type == COND_UNARY) { ! cprintf ("%s", cond->op->word); cprintf (" "); print_cond_node (cond->left); *************** *** 527,531 **** print_cond_node (cond->left); cprintf (" "); ! cprintf (cond->op->word); cprintf (" "); print_cond_node (cond->right); --- 530,534 ---- print_cond_node (cond->left); cprintf (" "); ! cprintf ("%s", cond->op->word); cprintf (" "); print_cond_node (cond->right); *************** *** 533,537 **** else if (cond->type == COND_TERM) { ! cprintf (cond->op->word); /* need to add quoting here */ } } --- 536,540 ---- else if (cond->type == COND_TERM) { ! cprintf ("%s", cond->op->word); /* need to add quoting here */ } } *************** *** 897,901 **** { register char *s; ! char char_arg[2], *argp, *args[2]; int arg_len, c, arg_index; --- 900,904 ---- { register char *s; ! char char_arg[2], *argp, *args[2], intbuf[32]; int arg_len, c, arg_index; *************** *** 934,941 **** case 'd': ! argp = itos (pointer_to_int (args[arg_index])); arg_index++; arg_len = strlen (argp); - free_argp = 1; break; --- 937,943 ---- case 'd': ! argp = inttostr (pointer_to_int (args[arg_index]), intbuf, sizeof (intbuf)); arg_index++; arg_len = strlen (argp); break; *************** *** 977,981 **** { register char *s; ! char char_arg[2], *argp; int digit_arg, arg_len, c; va_list args; --- 979,983 ---- { register char *s; ! char char_arg[2], *argp, intbuf[32]; int digit_arg, arg_len, c; va_list args; *************** *** 1021,1027 **** case 'd': digit_arg = va_arg (args, int); ! argp = itos (digit_arg); arg_len = strlen (argp); - free_argp = 1; break; --- 1023,1028 ---- case 'd': digit_arg = va_arg (args, int); ! argp = inttostr (digit_arg, intbuf, sizeof (intbuf)); arg_len = strlen (argp); break; diff -aNrc2 bash-2.02.1/shell.c bash-2.03/shell.c *** bash-2.02.1/shell.c Thu May 21 13:17:13 1998 --- bash-2.03/shell.c Thu Feb 18 11:42:27 1999 *************** *** 74,77 **** --- 74,81 ---- #include + #if defined (__OPENNT) + # include + #endif + #if !defined (HAVE_GETPW_DECLS) extern struct passwd *getpwuid (); *************** *** 82,85 **** --- 86,93 ---- #endif + #if defined (NO_MAIN_ENV_ARG) + extern char **environ; /* used if no third argument to main() */ + #endif + extern char *dist_version, *release_status; extern int patch_level, build_version; *************** *** 111,115 **** 0 = not login shell. 1 = login shell from getty (or equivalent fake out) ! -1 = login shell from "-login" flag. -2 = both from getty, and from flag. */ --- 119,123 ---- 0 = not login shell. 1 = login shell from getty (or equivalent fake out) ! -1 = login shell from "--login" flag. -2 = both from getty, and from flag. */ *************** *** 272,284 **** #endif /* __CYGWIN32__ */ int main (argc, argv, env) int argc; char **argv, **env; { register int i; ! int code, saverst; volatile int locally_skip_execution; volatile int arg_index, top_level_arg_index; /* Catch early SIGINTs. */ --- 280,305 ---- #endif /* __CYGWIN32__ */ + #if defined (NO_MAIN_ENV_ARG) + /* systems without third argument to main() */ + int + main (argc, argv) + int argc; + char **argv; + #else /* !NO_MAIN_ENV_ARG */ int main (argc, argv, env) int argc; char **argv, **env; + #endif /* !NO_MAIN_ENV_ARG */ { register int i; ! int code, saverst, old_errexit_flag; volatile int locally_skip_execution; volatile int arg_index, top_level_arg_index; + #ifdef __OPENNT + char **env; + + env = environ; + #endif /* __OPENNT */ /* Catch early SIGINTs. */ *************** *** 462,465 **** --- 483,487 ---- top_level_arg_index = arg_index; + old_errexit_flag = exit_immediately_on_error; /* Give this shell a place to longjmp to before executing the *************** *** 477,480 **** --- 499,505 ---- set_job_control (interactive_shell); #endif + /* Reset value of `set -e', since it's turned off before running + the startup files. */ + exit_immediately_on_error += old_errexit_flag; locally_skip_execution++; } *************** *** 498,509 **** #if defined (RESTRICTED_SHELL) /* If the `-r' option is supplied at invocation, make sure that the shell is not in restricted mode when running the startup files. */ ! saverst = restricted; ! restricted = 0; #endif if (locally_skip_execution == 0 && running_setuid == 0) ! run_startup_files (); /* If we are invoked as `sh', turn on Posix mode. */ --- 523,547 ---- #if defined (RESTRICTED_SHELL) + /* Set restricted_shell based on whether the basename of $0 indicates that + the shell should be restricted or if the `-r' option was supplied at + startup. */ + restricted_shell = shell_is_restricted (shell_name); + /* If the `-r' option is supplied at invocation, make sure that the shell is not in restricted mode when running the startup files. */ ! saverst = restricted; ! restricted = 0; #endif + /* The startup files are run with `set -e' temporarily disabled. */ if (locally_skip_execution == 0 && running_setuid == 0) ! { ! old_errexit_flag = exit_immediately_on_error; ! exit_immediately_on_error = 0; ! ! run_startup_files (); ! ! exit_immediately_on_error += old_errexit_flag; ! } /* If we are invoked as `sh', turn on Posix mode. */ *************** *** 837,841 **** --- 875,883 ---- { #ifdef SYS_BASHRC + # if defined (__OPENNT) + maybe_execute_file (_prefixInstallPath(SYS_BASHRC, NULL, 0), 1); + # else maybe_execute_file (SYS_BASHRC, 1); + # endif #endif maybe_execute_file (bashrc_file, 1); *************** *** 851,856 **** sourced_login = 0; ! #if defined (NON_INTERACTIVE_LOGIN_SHELLS) ! if (login_shell) { /* We don't execute .bashrc for login shells. */ --- 893,897 ---- sourced_login = 0; ! if (login_shell < 0 && posixly_correct == 0) /* --login flag and not posix */ { /* We don't execute .bashrc for login shells. */ *************** *** 872,876 **** sourced_login = 1; } - #endif /* NON_INTERACTIVE_LOGIN_SHELLS */ /* A non-interactive shell not named `sh' and not in posix mode reads and --- 913,916 ---- *************** *** 912,916 **** --- 952,960 ---- { #ifdef SYS_BASHRC + # if defined (__OPENNT) + maybe_execute_file (_prefixInstallPath(SYS_BASHRC, NULL, 0), 1); + # else maybe_execute_file (SYS_BASHRC, 1); + # endif` #endif maybe_execute_file (bashrc_file, 1); *************** *** 933,940 **** #if defined (RESTRICTED_SHELL) /* Perhaps make this shell a `restricted' one, based on NAME. If the basename of NAME is "rbash", then this shell is restricted. The name of the restricted shell is a configurable option, see config.h. ! In a restricted shell, PATH and SHELL are read-only and non-unsettable. Do this also if `restricted' is already set to 1; maybe the shell was started with -r. */ --- 977,1000 ---- #if defined (RESTRICTED_SHELL) + /* Return 1 if the shell should be a restricted one based on NAME or the + value of `restricted'. Don't actually do anything, just return a + boolean value. */ + int + shell_is_restricted (name) + char *name; + { + char *temp; + + if (restricted) + return 1; + temp = base_pathname (name); + return (STREQ (temp, RESTRICTED_SHELL_NAME)); + } + /* Perhaps make this shell a `restricted' one, based on NAME. If the basename of NAME is "rbash", then this shell is restricted. The name of the restricted shell is a configurable option, see config.h. ! In a restricted shell, PATH, SHELL, ENV, and BASH_ENV are read-only ! and non-unsettable. Do this also if `restricted' is already set to 1; maybe the shell was started with -r. */ *************** *** 950,953 **** --- 1010,1015 ---- set_var_read_only ("PATH"); set_var_read_only ("SHELL"); + set_var_read_only ("ENV"); + set_var_read_only ("BASH_ENV"); restricted++; } *************** *** 1012,1016 **** return last_command_exit_value = 1; default: ! programming_error ("run_wordexp: bad jump: code %d", code); } } --- 1074,1078 ---- return last_command_exit_value = 1; default: ! command_error ("run_wordexp", CMDERR_BADJUMP, code, 0); } } *************** *** 1085,1089 **** return last_command_exit_value = 1; default: ! programming_error ("run_one_command: bad jump: code %d", code); } } --- 1147,1151 ---- return last_command_exit_value = 1; default: ! command_error ("run_one_command", CMDERR_BADJUMP, code, 0); } } *************** *** 1209,1213 **** /* Open the script. But try to move the file descriptor to a randomly large one, in the hopes that any descriptors used by the script will ! not match with ours. */ fd = move_to_high_fd (fd, 0, -1); --- 1271,1275 ---- /* Open the script. But try to move the file descriptor to a randomly large one, in the hopes that any descriptors used by the script will ! not match with ours. */ fd = move_to_high_fd (fd, 0, -1); *************** *** 1560,1564 **** int fd; { ! #if defined (HAVE_GETPEERNAME) && !defined (SVR4_2) int rv, l; struct sockaddr sa; --- 1622,1626 ---- int fd; { ! #if defined (HAVE_GETPEERNAME) && !defined (SVR4_2) && !defined (__BEOS__) int rv, l; struct sockaddr sa; *************** *** 1568,1572 **** /* Solaris 2.5 getpeername() returns EINVAL if the fd is not a socket. */ return ((rv < 0 && (errno == ENOTSOCK || errno == EINVAL)) ? 0 : 1); ! #else /* !HAVE_GETPEERNAME || SVR4_2 */ # if defined (SVR4) || defined (SVR4_2) /* Sockets on SVR4 and SVR4.2 are character special (streams) devices. */ --- 1630,1634 ---- /* Solaris 2.5 getpeername() returns EINVAL if the fd is not a socket. */ return ((rv < 0 && (errno == ENOTSOCK || errno == EINVAL)) ? 0 : 1); ! #else /* !HAVE_GETPEERNAME || SVR4_2 || __BEOS__ */ # if defined (SVR4) || defined (SVR4_2) /* Sockets on SVR4 and SVR4.2 are character special (streams) devices. */ *************** *** 1583,1587 **** return (S_ISCHR (sb.st_mode)); # else /* !SVR4 && !SVR4_2 */ ! # if defined (S_ISSOCK) struct stat sb; --- 1645,1649 ---- return (S_ISCHR (sb.st_mode)); # else /* !SVR4 && !SVR4_2 */ ! # if defined (S_ISSOCK) && !defined (__BEOS__) struct stat sb; *************** *** 1589,1596 **** return (0); return (S_ISSOCK (sb.st_mode)); ! # else /* !S_ISSOCK */ return (0); ! # endif /* !S_ISSOCK */ # endif /* !SVR4 && !SVR4_2 */ ! #endif /* !HAVE_GETPEERNAME || SVR4_2 */ } --- 1651,1658 ---- return (0); return (S_ISSOCK (sb.st_mode)); ! # else /* !S_ISSOCK || __BEOS__ */ return (0); ! # endif /* !S_ISSOCK || __BEOS__ */ # endif /* !SVR4 && !SVR4_2 */ ! #endif /* !HAVE_GETPEERNAME || SVR4_2 || __BEOS__ */ } diff -aNrc2 bash-2.02.1/subst.c bash-2.03/subst.c *** bash-2.02.1/subst.c Tue Jun 30 12:09:45 1998 --- bash-2.03/subst.c Wed Jan 20 12:13:52 1999 *************** *** 80,83 **** --- 80,84 ---- /* Process ID of the last command executed within command substitution. */ pid_t last_command_subst_pid = NO_PID; + pid_t current_command_subst_pid = NO_PID; /* Extern functions and variables from different files. */ *************** *** 105,108 **** --- 106,111 ---- static char expand_param_error, expand_param_fatal; + static int doing_completion = 0; + static char *make_quoted_char (); static void remove_quoted_nulls (); *************** *** 114,117 **** --- 117,121 ---- static WORD_LIST *expand_string_leave_quoted (); static WORD_LIST *expand_string_for_rhs (); + static char *getifs (); static WORD_LIST *word_list_split (); static WORD_LIST *quote_list (), *dequote_list (); *************** *** 930,934 **** } ! if (c == 0 && nesting_level) { report_error ("bad substitution: no ending `}' in %s", string); --- 934,938 ---- } ! if (c == 0 && nesting_level && doing_completion == 0) { report_error ("bad substitution: no ending `}' in %s", string); *************** *** 988,992 **** /* Return 1 if the portion of STRING ending at EINDEX is quoted (there is an unclosed quoted string), or if the character at EINDEX is quoted ! by a backslash. */ int char_is_quoted (string, eindex) --- 992,1001 ---- /* Return 1 if the portion of STRING ending at EINDEX is quoted (there is an unclosed quoted string), or if the character at EINDEX is quoted ! by a backslash. DOING_COMPLETION is used to flag that the various ! single and double-quoted string parsing functions should not return an ! error if there are unclosed quotes or braces. */ ! ! #define CQ_RETURN(x) do { doing_completion = 0; return (x); } while (0) ! int char_is_quoted (string, eindex) *************** *** 996,999 **** --- 1005,1009 ---- int i, pass_next, quoted; + doing_completion = 1; for (i = pass_next = quoted = 0; i <= eindex; i++) { *************** *** 1002,1006 **** pass_next = 0; if (i >= eindex) /* XXX was if (i >= eindex - 1) */ ! return 1; continue; } --- 1012,1016 ---- pass_next = 0; if (i >= eindex) /* XXX was if (i >= eindex - 1) */ ! CQ_RETURN(1); continue; } *************** *** 1010,1014 **** : skip_double_quoted (string, ++i); if (i > eindex) ! return 1; i--; /* the skip functions increment past the closing quote. */ } --- 1020,1024 ---- : skip_double_quoted (string, ++i); if (i > eindex) ! CQ_RETURN(1); i--; /* the skip functions increment past the closing quote. */ } *************** *** 1019,1023 **** } } ! return (0); } --- 1029,1033 ---- } } ! CQ_RETURN(0); } *************** *** 1830,1834 **** return ((char *)NULL); ! l = call_expand_word_internal (w, 0, (int *)0, (int *)0); if (l) { --- 1840,1844 ---- return ((char *)NULL); ! l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0); if (l) { *************** *** 1857,1867 **** any errors or free any memory before aborting. */ static WORD_LIST * ! call_expand_word_internal (w, q, c, e) WORD_DESC *w; ! int q, *c, *e; { WORD_LIST *result; ! result = expand_word_internal (w, q, c, e); if (result == &expand_word_error) { --- 1867,1877 ---- any errors or free any memory before aborting. */ static WORD_LIST * ! call_expand_word_internal (w, q, i, c, e) WORD_DESC *w; ! int q, i, *c, *e; { WORD_LIST *result; ! result = expand_word_internal (w, q, i, c, e); if (result == &expand_word_error) { *************** *** 1894,1898 **** bzero ((char *)&td, sizeof (td)); td.word = string; ! tresult = call_expand_word_internal (&td, quoted, (int *)NULL, (int *)NULL); return (tresult); } --- 1904,1908 ---- bzero ((char *)&td, sizeof (td)); td.word = string; ! tresult = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); return (tresult); } *************** *** 1927,1931 **** and is used to correctly preserve quoted characters when expanding things like ${1+"$@"}. This does parameter expansion, command ! subsitution, arithmetic expansion, and word splitting. */ static WORD_LIST * expand_string_leave_quoted (string, quoted) --- 1937,1941 ---- and is used to correctly preserve quoted characters when expanding things like ${1+"$@"}. This does parameter expansion, command ! substitution, arithmetic expansion, and word splitting. */ static WORD_LIST * expand_string_leave_quoted (string, quoted) *************** *** 1965,1969 **** bzero ((char *)&td, sizeof (td)); td.word = string; ! tresult = call_expand_word_internal (&td, quoted, dollar_at_p, has_dollar_at); return (tresult); } --- 1975,1979 ---- bzero ((char *)&td, sizeof (td)); td.word = string; ! tresult = call_expand_word_internal (&td, quoted, 1, dollar_at_p, has_dollar_at); return (tresult); } *************** *** 2666,2670 **** WORD_LIST *result, *tresult; ! tresult = call_expand_word_internal (word, quoted, (int *)NULL, (int *)NULL); result = word_list_split (tresult); dispose_words (tresult); --- 2676,2680 ---- WORD_LIST *result, *tresult; ! tresult = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); result = word_list_split (tresult); dispose_words (tresult); *************** *** 2682,2686 **** WORD_LIST *result; ! result = call_expand_word_internal (word, quoted, (int *)NULL, (int *)NULL); return (result ? dequote_list (result) : result); } --- 2692,2696 ---- WORD_LIST *result; ! result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); return (result ? dequote_list (result) : result); } *************** *** 2693,2697 **** int quoted; { ! return (call_expand_word_internal (word, quoted, (int *)NULL, (int *)NULL)); } --- 2703,2707 ---- int quoted; { ! return (call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL)); } *************** *** 3213,3216 **** --- 3223,3227 ---- close (fildes[0]); + current_command_subst_pid = pid; last_command_exit_value = wait_for (pid); last_command_subst_pid = pid; *************** *** 3955,3963 **** int rsize, rptr, l, replen, mtype; ret = xmalloc (rsize = 64); ret[0] = '\0'; - mtype = mflags & MATCH_TYPEMASK; - for (replen = STRLEN (rep), rptr = 0, str = string;;) { --- 3966,3998 ---- int rsize, rptr, l, replen, mtype; + mtype = mflags & MATCH_TYPEMASK; + + /* Special cases: + * 1. A null pattern with mtype == MATCH_BEG means to prefix STRING + * with REP and return the result. + * 2. A null pattern with mtype == MATCH_END means to append REP to + * STRING and return the result. + */ + if ((pat == 0 || *pat == 0) && (mtype == MATCH_BEG || mtype == MATCH_END)) + { + replen = STRLEN (rep); + l = strlen (string); + ret = xmalloc (replen + l + 2); + if (mtype == MATCH_BEG) + { + strcpy (ret, rep); + strcpy (ret + replen, string); + } + else + { + strcpy (ret, string); + strcpy (ret + l, rep); + } + return (ret); + } + ret = xmalloc (rsize = 64); ret[0] = '\0'; for (replen = STRLEN (rep), rptr = 0, str = string;;) { *************** *** 4755,4758 **** --- 4790,4797 ---- QUOTED contains flag values defined in shell.h. + ISEXP is used to tell expand_word_internal that the word should be + treated as the result of an expansion. This has implications for + how IFS characters in the word are treated. + CONTAINS_DOLLAR_AT and EXPANDED_SOMETHING are return values; when non-null they point to an integer value which receives information about expansion. *************** *** 4770,4776 **** static WORD_LIST * ! expand_word_internal (word, quoted, contains_dollar_at, expanded_something) WORD_DESC *word; ! int quoted; int *contains_dollar_at; int *expanded_something; --- 4809,4815 ---- static WORD_LIST * ! expand_word_internal (word, quoted, isexp, contains_dollar_at, expanded_something) WORD_DESC *word; ! int quoted, isexp; int *contains_dollar_at; int *expanded_something; *************** *** 4809,4818 **** int has_dollar_at; - int expok; - register int c; /* Current character. */ int number; /* Temporary number value. */ int t_index; /* For calls to string_extract_xxx. */ istring = xmalloc (istring_size = DEFAULT_INITIAL_ARRAY_SIZE); istring[istring_index = 0] = '\0'; --- 4848,4857 ---- int has_dollar_at; register int c; /* Current character. */ int number; /* Temporary number value. */ int t_index; /* For calls to string_extract_xxx. */ + char ifscmap[256]; + istring = xmalloc (istring_size = DEFAULT_INITIAL_ARRAY_SIZE); istring[istring_index = 0] = '\0'; *************** *** 4827,4830 **** --- 4866,4883 ---- *contains_dollar_at = 0; + /* Cache a bitmap of characters in IFS for quoting IFS characters that are + not part of an expansion. POSIX.2 says this is a must. */ + temp = getifs (); + bzero (ifscmap, sizeof (ifscmap)); + for (temp1 = temp; temp1 && *temp1; temp1++) + #if 0 + /* This check compensates for what I think is a parsing problem -- the + end brace matching algorithms for ${...} expressions differ between + parse.y and subst.c. For instance, the parser passes + ${abc:-G { I } K } as one word when it should be three. */ + if (*temp1 != ' ' && *temp1 != '\t' && *temp1 != '\n') + #endif + ifscmap[*temp1] = 1; + /* Begin the expansion. */ *************** *** 4971,4975 **** has_dollar_at = 0; ! list = expand_word_internal (tword, Q_DOUBLE_QUOTES, &has_dollar_at, (int *)NULL); if (list == &expand_word_error || list == &expand_word_fatal) --- 5024,5028 ---- has_dollar_at = 0; ! list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &has_dollar_at, (int *)NULL); if (list == &expand_word_error || list == &expand_word_fatal) *************** *** 5118,5122 **** default: /* This is the fix for " $@ " */ ! if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) { temp = make_quoted_char (c); --- 5171,5175 ---- default: /* This is the fix for " $@ " */ ! if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (isexp == 0 && ifscmap[c])) { temp = make_quoted_char (c); *************** *** 5194,5197 **** --- 5247,5252 ---- if (word->flags & W_ASSIGNMENT) tword->flags |= W_ASSIGNMENT; /* XXX */ + if (word->flags & W_NOGLOB) + tword->flags |= W_NOGLOB; /* XXX */ if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) tword->flags |= W_QUOTED; *************** *** 5201,5211 **** char *ifs_chars; ! if (quoted_dollar_at || has_dollar_at) ! { ! var = find_variable ("IFS"); ! ifs_chars = var ? value_cell (var) : " \t\n"; ! } ! else ! ifs_chars = (char *)NULL; /* If we have $@, we need to split the results no matter what. If --- 5256,5260 ---- char *ifs_chars; ! ifs_chars = (quoted_dollar_at || has_dollar_at) ? getifs () : (char *)NULL; /* If we have $@, we need to split the results no matter what. If *************** *** 5225,5228 **** --- 5274,5279 ---- if (word->flags & W_ASSIGNMENT) tword->flags |= W_ASSIGNMENT; + if (word->flags & W_NOGLOB) + tword->flags |= W_NOGLOB; } } *************** *** 5339,5342 **** --- 5390,5403 ---- *******************************************/ + static char * + getifs () + { + SHELL_VAR *ifs; + + ifs = find_variable ("IFS"); + /* If IFS is unset, it defaults to " \t\n". */ + return (ifs ? value_cell (ifs) : " \t\n"); + } + /* This splits a single word into a WORD LIST on $IFS, but only if the word is not quoted. list_string () performs quote removal for us, even if we *************** *** 5412,5415 **** --- 5473,5479 ---- return ((WORD_LIST *)NULL); + if (varlist) + dispose_words (varlist); /* Clean up after previous error */ + varlist = (WORD_LIST *)NULL; vp = lp = tlist; *************** *** 5563,5567 **** --- 5627,5635 ---- /* If the word isn't an assignment and contains an unquoted pattern matching character, then glob it. */ + #if 0 if ((tlist->word->flags & W_ASSIGNMENT) == 0 && + #else + if ((tlist->word->flags & W_NOGLOB) == 0 && + #endif unquoted_glob_pattern_p (tlist->word->word)) { *************** *** 5728,5732 **** expanded_something = 0; expanded = expand_word_internal ! (tlist->word, 0, &has_dollar_at, &expanded_something); if (expanded == &expand_word_error || expanded == &expand_word_fatal) --- 5796,5800 ---- expanded_something = 0; expanded = expand_word_internal ! (tlist->word, 0, 0, &has_dollar_at, &expanded_something); if (expanded == &expand_word_error || expanded == &expand_word_fatal) *************** *** 5778,5783 **** /* The workhorse for expand_words () and expand_words_no_vars (). First arg is LIST, a WORD_LIST of words. ! Second arg DO_VARS is non-zero if you want to do environment and ! variable assignments, else zero. This does all of the substitutions: brace expansion, tilde expansion, --- 5846,5851 ---- /* The workhorse for expand_words () and expand_words_no_vars (). First arg is LIST, a WORD_LIST of words. ! Second arg EFLAGS is a flags word controlling which expansions are ! performed. This does all of the substitutions: brace expansion, tilde expansion, *************** *** 5786,5790 **** to the bits set in EFLAGS. Words with the W_QUOTED or W_NOSPLIT bits set, or for which no expansion is done, do not undergo word splitting. ! Words with the W_ASSIGNMENT bit set do not undergo pathname expansion. */ static WORD_LIST * expand_word_list_internal (list, eflags) --- 5854,5858 ---- to the bits set in EFLAGS. Words with the W_QUOTED or W_NOSPLIT bits set, or for which no expansion is done, do not undergo word splitting. ! Words with the W_NOGLOB bit set do not undergo pathname expansion. */ static WORD_LIST * expand_word_list_internal (list, eflags) diff -aNrc2 bash-2.02.1/support/Makefile.in bash-2.03/support/Makefile.in *** bash-2.02.1/support/Makefile.in Thu Feb 26 09:58:10 1998 --- bash-2.03/support/Makefile.in Thu Feb 18 12:11:01 1999 *************** *** 19,23 **** RM = rm -f ! SHELL = /bin/sh CC = @CC@ --- 19,23 ---- RM = rm -f ! SHELL = @MAKE_SHELL@ CC = @CC@ diff -aNrc2 bash-2.02.1/support/SYMLINKS bash-2.03/support/SYMLINKS *** bash-2.02.1/support/SYMLINKS Thu Mar 6 12:51:17 1997 --- bash-2.03/support/SYMLINKS Fri Jun 5 15:30:01 1998 *************** *** 11,14 **** --- 11,15 ---- lib/readline/posixjmp.h ../posixheaders/posixjmp.h lib/readline/posixstat.h ../posixheaders/posixstat.h + lib/readline/rlstdc.h ../posixheaders/stdc.h lib/readline/xmalloc.c ../malloc/xmalloc.c # diff -aNrc2 bash-2.02.1/support/config.guess bash-2.03/support/config.guess *** bash-2.02.1/support/config.guess Tue Jun 30 12:32:37 1998 --- bash-2.03/support/config.guess Tue Dec 29 09:10:39 1998 *************** *** 152,155 **** --- 152,167 ---- echo i386-qssl-qnx`echo ${UNAME_VERSION}` exit 0 ;; + BeBox:BeOS:*:*) + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; # end cases added for Bash alpha:OSF1:*:*) *************** *** 214,217 **** --- 226,232 ---- echo m68k-cbm-openbsd${UNAME_RELEASE} exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; arc64:OpenBSD:*:*) echo mips64el-unknown-openbsd${UNAME_RELEASE} *************** *** 316,323 **** exit 0 ;; Power?Macintosh:Rhapsody:*:*) ! echo powerpc-apple-nextstep${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) ! echo ${UNAME_MACHINE}-unknown-nextstep${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) --- 331,338 ---- exit 0 ;; Power?Macintosh:Rhapsody:*:*) ! echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) ! echo ${UNAME_MACHINE}-unknown-rhapsody${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) *************** *** 868,872 **** # says echo i586-unisys-sysv4 ! exit 0 ;; esac --- 883,887 ---- # says echo i586-unisys-sysv4 ! exit 0 ;; esac diff -aNrc2 bash-2.02.1/support/config.sub bash-2.03/support/config.sub *** bash-2.02.1/support/config.sub Tue Jun 30 12:32:38 1998 --- bash-2.03/support/config.sub Thu Dec 31 09:37:04 1998 *************** *** 95,99 **** -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ ! -apple) os= basic_machine=$1 --- 95,99 ---- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ ! -apple ) os= basic_machine=$1 *************** *** 185,189 **** | tandem-* | symmetric-* | drs6000-icl | *-*ardent | gould-gould \ | concurrent-* | ksr1-* | esa-ibm | fxc-alliant | *370-amdahl \ ! | *-convex) ;; # Recognize the various machine names and aliases which stand --- 185,189 ---- | tandem-* | symmetric-* | drs6000-icl | *-*ardent | gould-gould \ | concurrent-* | ksr1-* | esa-ibm | fxc-alliant | *370-amdahl \ ! | *-convex | sx4*-nec) ;; # Recognize the various machine names and aliases which stand *************** *** 210,214 **** ;; amiga | amiga-*) ! basic_machine=m68k-cbm ;; amigados) --- 210,219 ---- ;; amiga | amiga-*) ! # basic_machine=m68k-cbm ! basic_machine=m68k-unknown ! ;; ! amigaos) ! basic_machine=m68k-unknown ! os=-amigaos ;; amigados) *************** *** 406,409 **** --- 411,422 ---- basic_machine=m68000-convergent ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux + ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` *************** *** 640,644 **** # some cases the only manufacturer, in others, it is the most popular. mips) ! basic_machine=mips-mips ;; romp) --- 653,661 ---- # some cases the only manufacturer, in others, it is the most popular. mips) ! if test "x$os" = "x-linux" ; then ! basic_machine=mips-unknown ! else ! basic_machine=mips-mips ! fi ;; romp) *************** *** 720,724 **** | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ ! | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ --- 737,741 ---- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ ! | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ *************** *** 728,732 **** | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ ! | -linux-gnu* | -uxpv* | -qnx* | -powerux) # Remember, each alternative MUST END IN *, to match a version number. ;; --- 745,750 ---- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ ! | -linux-gnu* | -uxpv* | -qnx* | -powerux* | -beos* | -rhapsody* \ ! | -superux* ) # Remember, each alternative MUST END IN *, to match a version number. ;; *************** *** 844,847 **** --- 862,868 ---- os=-sunos4.1.1 ;; + *-be) + os=-beos + ;; *-ibm) os=-aix *************** *** 857,861 **** ;; *-cbm) ! os=-amigados ;; *-dg) --- 878,882 ---- ;; *-cbm) ! os=-amigaos ;; *-dg) diff -aNrc2 bash-2.02.1/support/missing bash-2.03/support/missing *** bash-2.02.1/support/missing Wed Dec 31 19:00:00 1969 --- bash-2.03/support/missing Wed Dec 16 10:47:23 1998 *************** *** 0 **** --- 1,188 ---- + #! /bin/sh + # Common stub for a few missing GNU programs while installing. + # Copyright (C) 1996, 1997 Free Software Foundation, Inc. + # Franc,ois Pinard , 1996. + + # This program 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 2, or (at your option) + # any later version. + + # This program 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. + + # 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., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + fi + + case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ + $0 [OPTION]... PROGRAM [ARGUMENT]... + + Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an + error status if there is no known handling for PROGRAM. + + Options: + -h, --help display this help and exit + -v, --version output version information and exit + + Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing - GNU libit 0.0" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`configure.in'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified \`configure.in'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`configure.in'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER([^):]*:\([^)]*\)).*/\1/p' configure.in` + if test -z "$files"; then + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^):]*\)).*/\1/p' configure.in` + test -z "$files" || files="$files.in" + else + files=`echo "$files" | sed -e 's/:/ /g'` + fi + test -z "$files" && files="config.h.in" + touch $files + ;; + + automake) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print \ + | sed 's/^\(.*\).am$/touch \1.in/' \ + | sh + ;; + + bison|yacc) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + makeinfo) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + *) + echo 1>&2 "\ + WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; + esac + + exit 0 diff -aNrc2 bash-2.02.1/support/mksignames.c bash-2.03/support/mksignames.c *** bash-2.02.1/support/mksignames.c Tue Feb 11 14:19:19 1997 --- bash-2.03/support/mksignames.c Wed Jan 20 16:50:20 1999 *************** *** 261,265 **** /* 4.4 BSD */ ! #if defined (SIGINFO) /* information request */ signal_names[SIGINFO] = "SIGINFO"; #endif --- 261,265 ---- /* 4.4 BSD */ ! #if defined (SIGINFO) && !defined (_SEQUENT_) /* information request */ signal_names[SIGINFO] = "SIGINFO"; #endif *************** *** 271,274 **** --- 271,278 ---- #if defined (SIGUSR2) /* user defined signal 2 */ signal_names[SIGUSR2] = "SIGUSR2"; + #endif + + #if defined (SIGKILLTHR) /* BeOS: Kill Thread */ + signal_names[SIGKILLTHR] = "SIGKILLTHR"; #endif diff -aNrc2 bash-2.02.1/support/rlvers.sh bash-2.03/support/rlvers.sh *** bash-2.02.1/support/rlvers.sh Wed Dec 31 19:00:00 1969 --- bash-2.03/support/rlvers.sh Thu May 21 12:43:21 1998 *************** *** 0 **** --- 1,71 ---- + #! /bin/sh + # + # rlvers.sh -- run a program that prints out the readline version number + # using locally-installed readline libraries + # + + PROGNAME=`basename $0` + + trap 'rm -f /tmp/rlvers /tmp/rlvers.?' 0 1 2 3 6 15 + + # defaults + CC=cc + RL_LIBDIR=/usr/local/lib + + while [ $# -gt 0 ]; do + case "$1" in + -C) shift ; CC="$1"; shift ;; + -L) shift ; RL_LIBDIR="$1" ; shift ;; + -v) shift ; verbose=y ;; + --) shift ; break ;; + *) echo "${PROGNAME}: usage: $PROGNAME [-C compiler] [-L libdir] [-v]" >&2 ; exit 2;; + esac + done + + # if someone happened to install examples/rlversion, use it (it's not + # installed by default) + if test -f ${RL_LIBDIR}/rlversion ; then + if [ -n "$verbose" ]; then + echo "${PROGNAME}: using installed rlversion from ${RL_LIBDIR}/rlversion" + fi + v=`${RL_LIBDIR}/rlversion 2>/dev/null` + case "$v" in + unknown | "") echo 0 ;; + *) echo "$v" ;; + esac + exit 0 + fi + + if [ -n "$verbose" ]; then + echo "${PROGNAME}: using ${RL_LIBDIR} to find libreadline" + echo "${PROGNAME}: attempting program compilation" + fi + + cat > /tmp/rlvers.c << EOF + #include + extern char *rl_library_version; + + main() + { + printf("%s\n", rl_library_version ? rl_library_version : "0"); + exit(0); + } + EOF + + if eval ${CC} -L${RL_LIBDIR} -o /tmp/rlvers /tmp/rlvers.c -lreadline -ltermcap -lcurses; + then + v=`/tmp/rlvers` + else + if [ -n "$verbose" ] ; then + echo "${PROGNAME}: compilation failed: status $?" + echo "${PROGNAME}: using version 0" + fi + v=0 + fi + + case "$v" in + unknown | "") echo 0 ;; + *) echo "$v" ;; + esac + + exit 0 diff -aNrc2 bash-2.02.1/support/shobj-conf bash-2.03/support/shobj-conf *** bash-2.02.1/support/shobj-conf Wed Dec 31 19:00:00 1969 --- bash-2.03/support/shobj-conf Tue Dec 29 15:05:29 1998 *************** *** 0 **** --- 1,341 ---- + #! /bin/sh + # + # shobj-conf -- output a series of variable assignments to be substituted + # into a Makefile by configure which specify system-dependent + # information for creating shared objects that may be loaded + # into bash with `enable -f' + # + # usage: shobj-conf [-C compiler] -c host_cpu -o host_os -v host_vendor + # + # Chet Ramey + # chet@po.cwru.edu + + # + # defaults + # + SHOBJ_STATUS=supported + SHLIB_STATUS=supported + + SHOBJ_CC=cc + SHOBJ_CFLAGS= + SHOBJ_LD= + SHOBJ_LDFLAGS= + SHOBJ_XLDFLAGS= + SHOBJ_LIBS= + + SHLIB_XLDFLAGS= + SHLIB_LIBS= + SHLIB_LIBSUFF='so' + + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF)' + + PROGNAME=`basename $0` + USAGE="$PROGNAME [-C compiler] -c host_cpu -o host_os -v host_vendor" + + while [ $# -gt 0 ]; do + case "$1" in + -C) shift; SHOBJ_CC="$1"; shift ;; + -c) shift; host_cpu="$1"; shift ;; + -o) shift; host_os="$1"; shift ;; + -v) shift; host_vendor="$1"; shift ;; + *) echo "$USAGE" >&2 ; exit 2;; + esac + done + + case "${host_os}-${SHOBJ_CC}" in + sunos4*-gcc*) + SHOBJ_CFLAGS=-fpic + SHOBJ_LD=/usr/bin/ld + SHOBJ_LDFLAGS='-assert pure-text' + + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' + ;; + + sunos4*) + SHOBJ_CFLAGS=-pic + SHOBJ_LD=/usr/bin/ld + SHOBJ_LDFLAGS='-assert pure-text' + + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' + ;; + + sunos5*-gcc*|solaris2*-gcc*) + SHOBJ_CFLAGS=-fpic + SHOBJ_LD='${CC}' + SHOBJ_LDFLAGS='-shared -Wl,-i' + + SHLIB_XLDFLAGS='-R $(libdir)' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + sunos5*|solaris2*) + SHOBJ_CFLAGS='-K pic' + SHOBJ_LD=/usr/ccs/bin/ld + SHOBJ_LDFLAGS='-G -dy -z text -i -h $@' + + SHLIB_XLDFLAGS='-R $(libdir)' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + freebsd2* | netbsd* | openbsd*) + SHOBJ_CFLAGS=-fpic + SHOBJ_LD=ld + SHOBJ_LDFLAGS='-x -Bshareable' + + SHLIB_XLDFLAGS='-R$(libdir)' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' + ;; + + freebsd3*) + SHOBJ_CFLAGS=-fpic + SHOBJ_LD='${CC}' + SHOBJ_LDFLAGS='-shared' + + SHLIB_XLDFLAGS='-R$(libdir)' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' + ;; + + linux*) + SHOBJ_CFLAGS=-fPIC + SHOBJ_LD='${CC}' + SHOBJ_LDFLAGS='-shared -Wl,-soname,$@' + + SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' + ;; + + bsdi2*) + SHOBJ_CC=shlicc2 + SHOBJ_CFLAGS= + SHOBJ_LD=ld + SHOBJ_LDFLAGS=-r + SHOBJ_LIBS=-lc_s.2.1.0 + + # BSD/OS 2.x and 3.x `shared libraries' are too much of a pain in + # the ass -- they require changing {/usr/lib,etc}/shlib.map on + # each system, and the library creation process is byzantine + SHLIB_STATUS=unsupported + ;; + + bsdi3*) + SHOBJ_CC=shlicc2 + SHOBJ_CFLAGS= + SHOBJ_LD=ld + SHOBJ_LDFLAGS=-r + SHOBJ_LIBS=-lc_s.3.0.0 + + # BSD/OS 2.x and 3.x `shared libraries' are too much of a pain in + # the ass -- they require changing {/usr/lib,etc}/shlib.map on + # each system, and the library creation process is byzantine + SHLIB_STATUS=unsupported + ;; + + bsdi4*) + # BSD/OS 4.x now supports ELF and SunOS-style dynamically-linked + # shared libraries. gcc 2.x is the standard compiler, and the + # `normal' gcc options should work as they do in Linux. + + SHOBJ_CFLAGS=-fPIC + SHOBJ_LD='${CC}' + SHOBJ_LDFLAGS='-shared -Wl,-soname,$@' + + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' + ;; + + osf*) + SHOBJ_LD=ld + SHOBJ_LDFLAGS='-shared -soname $@ -expect_unresolved "*"' + + SHLIB_XLDFLAGS='-rpath $(libdir)' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + aix4.[2-9]*-gcc*) # lightly tested by jik@cisco.com + SHOBJ_CFLAGS=-fpic + SHOBJ_LD='ld' + SHOBJ_LDFLAGS='-bdynamic -bnoentry -bexpall' + SHOBJ_XLDFLAGS='-G' + + SHLIB_XLDFLAGS='-bM:SRE' + SHLIB_LIBS='-lcurses -lc' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + aix4.[2-9]*) + SHOBJ_CFLAGS=-K + SHOBJ_LD='ld' + SHOBJ_LDFLAGS='-bdynamic -bnoentry -bexpall' + SHOBJ_XLDFLAGS='-G' + + SHLIB_XLDFLAGS='-bM:SRE' + SHLIB_LIBS='-lcurses -lc' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + # + # THE FOLLOWING ARE UNTESTED -- and some may not support the dlopen interface + # + irix[56]*-gcc*) + SHOBJ_CFLAGS='-fpic' + SHOBJ_LD='${CC}' + SHOBJ_LDFLAGS='-shared -Wl,-soname,$@' + + SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + irix[56]*) + SHOBJ_CFLAGS='-K PIC' + SHOBJ_LD=ld + SHOBJ_LDFLAGS='-call_shared -hidden_symbol -no_unresolved -soname $@' + + SHLIB_XLDFLAGS='-rpath $(libdir)' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + hpux9*-gcc*) + # must use gcc; the bundled cc cannot compile PIC code + SHOBJ_CFLAGS='-fpic' + SHOBJ_LD='${CC}' + SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s' + + SHLIB_XLDFLAGS='-Wl,+b,$(libdir)' + SHLIB_LIBSUFF='sl' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + hpux9*) + SHOBJ_STATUS=unsupported + SHLIB_STATUS=unsupported + ;; + + hpux10*-gcc*) + # must use gcc; the bundled cc cannot compile PIC code + SHOBJ_CFLAGS='-fpic' + SHOBJ_LD='${CC}' + SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s' + + SHLIB_XLDFLAGS='-Wl,+h,$@ -Wl,+b,$(libdir)' + SHLIB_LIBSUFF='sl' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + hpux10*) + SHOBJ_STATUS=unsupported + SHLIB_STATUS=unsupported + ;; + + hpux11*-gcc*) + # must use gcc; the bundled cc cannot compile PIC code + SHOBJ_CFLAGS='-fpic' + SHOBJ_LD='${CC}' + # SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,-B,symbolic -Wl,+s -Wl,+std -Wl,+h,$@' + SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s -Wl,+h,$@' + + SHLIB_XLDFLAGS='-Wl,+b,$(libdir)' + SHLIB_LIBSUFF='sl' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + hpux11*) + SHOBJ_STATUS=unsupported + SHLIB_STATUS=unsupported + ;; + + sysv4*-gcc*) + SHOBJ_CFLAGS=-shared + SHOBJ_LDFLAGS='-shared -h $@' + SHOBJ_LD='${CC}' + + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + sysv4*) + SHOBJ_CFLAGS='-K PIC' + SHOBJ_LD=ld + SHOBJ_LDFLAGS='-dy -z text -G -h $@' + + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + sco3.2v5*-gcc*) + SHOBJ_CFLAGS='-fpic' # DEFAULTS TO ELF + SHOBJ_LD='${CC}' + SHOBJ_LDFLAGS='-shared' + + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + sco3.2v5*) + SHOBJ_CFLAGS='-K pic -b elf' + SHOBJ_LD=ld + SHOBJ_LDFLAGS='-G -b elf -dy -z text -h $@' + + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + sysv5uw7*-gcc*) + SHOBJ_CFLAGS='-fpic' + SHOBJ_LD='${CC}' + SHOBJ_LDFLAGS='-shared' + + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + sysv5uw7*) + SHOBJ_CFLAGS='-K PIC' + SHOBJ_LD=ld + SHOBJ_LDFLAGS='-G -dy -z text -h $@' + + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + dgux*-gcc*) + SHOBJ_CFLAGS=-fpic + SHOBJ_LD='${CC}' + SHOBJ_LDFLAGS='-shared' + + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + dgux*) + SHOBJ_CFLAGS='-K pic' + SHOBJ_LD=ld + SHOBJ_LDFLAGS='-G -dy -h $@' + + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + # + # Rely on correct gcc configuration for everything else + # + *-gcc*) + SHOBJ_CFLAGS=-fpic + SHOBJ_LD='${CC}' + SHOBJ_LDFLAGS='-shared' + + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + ;; + + *) + SHOBJ_STATUS=unsupported + SHLIB_STATUS=unsupported + ;; + + esac + + echo SHOBJ_CC=\'"$SHOBJ_CC"\' + echo SHOBJ_CFLAGS=\'"$SHOBJ_CFLAGS"\' + echo SHOBJ_LD=\'"$SHOBJ_LD"\' + echo SHOBJ_LDFLAGS=\'"$SHOBJ_LDFLAGS"\' + echo SHOBJ_XLDFLAGS=\'"$SHOBJ_XLDFLAGS"\' + echo SHOBJ_LIBS=\'"$SHOBJ_LIBS"\' + + echo SHLIB_XLDFLAGS=\'"$SHLIB_XLDFLAGS"\' + echo SHLIB_LIBS=\'"$SHLIB_LIBS"\' + echo SHLIB_LIBSUFF=\'"$SHLIB_LIBSUFF"\' + echo SHLIB_LIBVERSION=\'"$SHLIB_LIBVERSION"\' + + echo SHOBJ_STATUS=\'"$SHOBJ_STATUS"\' + echo SHLIB_STATUS=\'"$SHLIB_STATUS"\' + + exit 0 diff -aNrc2 bash-2.02.1/support/texi2dvi bash-2.03/support/texi2dvi *** bash-2.02.1/support/texi2dvi Tue Jul 25 10:55:57 1995 --- bash-2.03/support/texi2dvi Mon Apr 27 12:00:44 1998 *************** *** 1,9 **** #! /bin/sh # texi2dvi --- smartly produce DVI files from texinfo sources ! ! # Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. ! ! # $Id: texi2dvi,v 0.5 1995/06/20 02:21:36 friedman Exp $ ! # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by --- 1,8 ---- #! /bin/sh # texi2dvi --- smartly produce DVI files from texinfo sources ! # $Id: texi2dvi,v 0.8 1998/02/26 21:13:13 karl Exp $ ! # ! # Copyright (C) 1992, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc. ! # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by *************** *** 20,32 **** # program's maintainer or write to: The Free Software Foundation, # Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. ! # Commentary: ! ! # Author: Noah Friedman ! ! # Please send bug reports, etc. to bug-texinfo@prep.ai.mit.edu # If possible, please send a copy of the output of the script called with # the `--debug' option when making a bug report. ! # In the interest of general portability, some common bourne shell # constructs were avoided because they weren't guaranteed to be available --- 19,31 ---- # program's maintainer or write to: The Free Software Foundation, # Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. ! # # Commentary: ! # ! # Author: Noah Friedman ! # ! # Please send bug reports, etc. to bug-texinfo@gnu.org. # If possible, please send a copy of the output of the script called with # the `--debug' option when making a bug report. ! # # In the interest of general portability, some common bourne shell # constructs were avoided because they weren't guaranteed to be available *************** *** 35,45 **** # denominator is rapidly diminishing. # ! # Among the more interesting lossages I noticed with some bourne shells ! # are: # * No shell functions. # * No `unset' builtin. # * `shift' cannot take a numeric argument, and signals an error if # there are no arguments to shift. ! # Code: --- 34,43 ---- # denominator is rapidly diminishing. # ! # Among the more interesting lossages I noticed among Bourne shells: # * No shell functions. # * No `unset' builtin. # * `shift' cannot take a numeric argument, and signals an error if # there are no arguments to shift. ! # # Code: *************** *** 48,52 **** # This string is expanded by rcs automatically when this file is checked out. ! rcs_revision='$Revision: 0.5 $' version=`set - $rcs_revision; echo $2` --- 46,50 ---- # This string is expanded by rcs automatically when this file is checked out. ! rcs_revision='$Revision: 0.8 $' version=`set - $rcs_revision; echo $2` *************** *** 55,82 **** eq="'" ! usage="Usage: $progname {options} [file1] {file2 {...}} ! (version $version) ! Options are: -D, --debug Turn on shell debugging ($bq${bq}set -x$eq$eq). ! -h, --help You're looking at it. ! -v, --version Print version number. ! Arguments in brackets are required. Those in braces are optional. ! " # Initialize variables. # Don't use `unset' since old bourne shells don't have this command. # Instead, assign them an empty value. ! # Some of these, like TEX and TEXINDEX, may be inherited from the environment ! backup_extension=.bak debug= orig_pwd="`pwd`" ! verbose= texindex="${TEXINDEX-texindex}" tex="${TEX-tex}" ! # Save this so we can construct a new TEXINPUTS path for each file to be ! # processed. TEXINPUTS_orig="$TEXINPUTS" export TEXINPUTS --- 53,89 ---- eq="'" ! usage="Usage: $0 [OPTION]... FILE... ! Run a Texinfo document through TeX. ! Options: ! -b, --batch No interaction (\nonstopmode in TeX). ! -c, --clean Remove all auxiliary files. -D, --debug Turn on shell debugging ($bq${bq}set -x$eq$eq). ! -t, --texinfo CMD Insert CMD after @setfilename before running TeX. ! --verbose Report on what is done. ! -h, --help Display this help and exit. ! -v, --version Display version information and exit. ! The values of the TEX, TEXINDEX, and MAKEINFO environment variables are ! used to run those commands, if they are set. ! ! Email bug reports to bug-texinfo@gnu.org." # Initialize variables. # Don't use `unset' since old bourne shells don't have this command. # Instead, assign them an empty value. ! # Some of these, like TEX and TEXINDEX, may be inherited from the environment. ! backup_extension=.bak # these files get deleted if all goes well. ! batch= ! clean= debug= orig_pwd="`pwd`" ! textra= ! verbose=false ! makeinfo="${MAKEINFO-makeinfo}" texindex="${TEXINDEX-texindex}" tex="${TEX-tex}" ! # Save this so we can construct a new TEXINPUTS path for each file. TEXINPUTS_orig="$TEXINPUTS" export TEXINPUTS *************** *** 87,109 **** # Long options which take arguments will need a `*' appended to the # canonical name to match the value appended after the `=' character. ! while : ; do ! case $# in 0) break ;; esac case "$1" in ! -D | --debug | --d* ) ! debug=t ! shift ! ;; ! -h | --help | --h* ) ! echo "$usage" 1>&2 ! exit 0 ! ;; ! -v | --version | --v* ) ! echo "texi2dvi version $version" 1>&2 ! exit 0 ! ;; -- ) # Stop option processing shift ! break ! ;; -* ) case "$1" in --- 94,118 ---- # Long options which take arguments will need a `*' appended to the # canonical name to match the value appended after the `=' character. ! while :; do ! test $# -eq 0 && break ! case "$1" in ! -b | --batch | --b* ) batch=t; shift ;; ! -c | --clean | --c* ) clean=t; shift ;; ! -D | --debug | --d* ) debug=t; shift ;; ! -h | --help | --h* ) echo "$usage"; exit 0 ;; ! # OK, we should do real option parsing here, but be lazy for now. ! -t | --texinfo | --t*) shift; textra="$textra $1"; shift ;; ! -v | --vers* ) ! echo "$progname (GNU Texinfo 3.12) $version" ! echo "Copyright (C) 1998 Free Software Foundation, Inc. ! There is NO warranty. You may redistribute this software ! under the terms of the GNU General Public License. ! For more information about these matters, see the files named COPYING." ! exit 0 ;; ! --verb* ) verbose=echo; shift ;; -- ) # Stop option processing shift ! break ;; -* ) case "$1" in *************** *** 112,275 **** esac exec 1>&2 ! echo "$progname: unknown or ambiguous option $bq$arg$eq" ! echo "$progname: Use $bq--help$eq for a list of options." ! exit 1 ! ;; ! * ) ! break ! ;; esac done # See if there are any command line args left (which will be interpreted as ! # filename arguments) ! case $# in ! 0 ) ! exec 1>&2 ! echo "$progname: at least one file name is required as an argument." ! echo "$progname: Use $bq--help$eq for a description of command syntax." ! exit 2 ! ;; ! esac ! case "$debug" in t ) set -x ;; esac # Texify files ! for command_line_filename in ${1+"$@"} ; do ! # Roughly equivalent to `dirname ...`, but more portable ! directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`" ! filename_texi="`basename ${command_line_filename}`" ! # Strip off the last extension part (probably .texinfo or .texi) ! filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`" ! ! # If directory and file are the same, then it's probably because there's ! # no pathname component. Set dirname to `.', the current directory. ! if test "z${directory}" = "z${command_line_filename}" ; then ! directory="." ! fi ! ! # Source file might @include additional texinfo sources. Put `.' and ! # directory where source file(s) reside in TEXINPUTS before anything ! # else. `.' goes first to ensure that any old .aux, .cps, etc. files in ! # ${directory} don't get used in preference to fresher files in `.'. ! TEXINPUTS=".:${directory}:${TEXINPUTS_orig}" ! ! # "Unset" variables that might have values from previous iterations and ! # which won't be completely reset later. ! definite_index_files="" ! ! # See if file exists here. If it doesn't we're in trouble since, even ! # though the user may be able to reenter a valid filename at the tex ! # prompt (assuming they're attending the terminal), this script won't be ! # able to find the right index files and so forth. ! if test ! -r "${command_line_filename}" ; then ! echo "${progname}: ${command_line_filename}: No such file or permission denied." 1>&2 ! continue; ! fi ! ! # Find all files having root filename with a two-letter extension, ! # determine whether they're really index files, and save them. Foo.aux ! # is actually the cross-references file, but we need to keep track of ! # that too. ! possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`" ! for this_file in ${possible_index_files} ; do # If file is empty, forget it. ! if test ! -s "${this_file}" ; then ! continue; ! fi ! # Examine first character of file. If it's not a backslash or ! # single quote, then it's definitely not an index or xref file. first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`" ! if test "${first_character}" = "\\" -o "${first_character}" = "'" ; then ! definite_index_files="${definite_index_files} ${this_file}" fi ! done ! orig_index_files="${definite_index_files}" ! orig_index_files_sans_aux="`echo ${definite_index_files} \ ! | sed 's/'${filename_noext}'\.aux//; ! s/^[ ]*//;s/[ ]*$//;'`" ! ! # Now save copies of original index files so we have some means of ! # comparison later. ! for index_file_to_save in ${orig_index_files} ; do ! cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}" ! done ! ! # Run texindex on current index files. If they already exist, and ! # after running TeX a first time the index files don't change, then ! # there's no reason to run TeX again. But we won't know that if the ! # index files are out of date or nonexistent. ! if test "${orig_index_files_sans_aux}" ; then ${texindex} ${orig_index_files_sans_aux} ! fi ! if ${tex} ${command_line_filename} ; then # TeX run first time ! definite_index_files="" ! # Get list of new index files ! possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`" ! for this_file in ${possible_index_files} ; do ! # If file is empty, forget it. ! if test ! -s ${this_file} ; then ! continue; ! fi ! ! # Examine first character of file. If it's not a backslash or ! # single quote, then it's definitely not an index or xref file. ! first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`" ! if test "${first_character}" = "\\" -o "${first_character}" = "'" ; then ! definite_index_files="${definite_index_files} ${this_file}" ! fi done ! new_index_files="${definite_index_files}" ! new_index_files_sans_aux="`echo ${definite_index_files} \ ! | sed 's/'${filename_noext}'\.aux//; ! s/^[ ]*//;s/[ ]*$//;'`" ! ! # If old and new list don't at least have the same file list, then one ! # file or another has definitely changed. ! if test "${orig_index_files}" != "${new_index_files}" ; then ! index_files_changed_p=t ! else ! # File list is the same. We must compare each file until we find a ! # difference. ! index_files_changed_p="" ! for this_file in ${new_index_files} ; do ! # cmp -s will return nonzero exit status if files differ. ! cmp -s "${this_file}" "${this_file}${backup_extension}" ! if test $? -ne 0 ; then ! # We only need to keep comparing until we find *one* that ! # differs, because we'll have to run texindex & tex no ! # matter what. ! index_files_changed_p=t ! break ! fi ! done ! fi ! # If index files have changed since TeX has been run, or if the aux ! # file wasn't present originally, run texindex and TeX again. ! if test "${index_files_changed_p}" ; then ! retval=0 ! if test "${new_index_files_sans_aux}" ; then ! ${texindex} ${new_index_files_sans_aux} ! retval=$? ! fi ! if test ${retval} -eq 0 ; then ! ${tex} "${command_line_filename}" ! fi ! fi ! fi ! # Generate list of files to delete, then call rm once with the entire ! # list. This is significantly faster than multiple executions of rm. ! file_list="" ! for file in ${orig_index_files} ; do ! file_list="${file_list} ${file}${backup_extension}" ! done ! if test "${file_list}" ; then ! rm -f ${file_list} ! fi done ! # texi2dvi ends here --- 121,362 ---- esac exec 1>&2 ! echo "$progname: Unknown or ambiguous option $bq$arg$eq." ! echo "$progname: Try $bq--help$eq for more information." ! exit 1 ;; ! * ) break ;; esac done # See if there are any command line args left (which will be interpreted as ! # filename arguments). ! if test $# -eq 0; then ! exec 1>&2 ! echo "$progname: At least one file name is required as an argument." ! echo "$progname: Try $bq--help$eq for more information." ! exit 2 ! fi ! test "$debug" = t && set -x # Texify files ! for command_line_filename in ${1+"$@"}; do ! $verbose "Processing $command_line_filename ..." ! ! # See if file exists. If it doesn't we're in trouble since, even ! # though the user may be able to reenter a valid filename at the tex ! # prompt (assuming they're attending the terminal), this script won't ! # be able to find the right index files and so forth. ! if test ! -r "${command_line_filename}"; then ! echo "$0: Could not read ${command_line_filename}." >&2 ! continue ! fi ! ! # Roughly equivalent to `dirname ...`, but more portable ! directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`" ! filename_texi="`basename ${command_line_filename}`" ! # Strip off the last extension part (probably .texinfo or .texi) ! filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`" ! ! # Use same basename since we want to generate aux files with the same ! # basename as the manual. Use extension .texi for the temp file so ! # that TeX will ignore it. Thus, we must use a subdirectory. ! # ! # Output the macro-expanded file to here. The vastly abbreviated ! # temporary directory name is so we don't have collisions on 8.3 or ! # 14-character filesystems. ! tmp_dir=${TMPDIR-/tmp}/txi2d.$$ ! filename_tmp=$tmp_dir/$filename_noext.texi ! # Output the file with the user's extra commands to here. ! tmp_dir2=${tmp_dir}.2 ! filename_tmp2=$tmp_dir2/$filename_noext.texi ! mkdir $tmp_dir $tmp_dir2 ! # Always remove the temporary directories. ! trap "rm -rf $tmp_dir $tmp_dir2" 1 2 15 ! ! # If directory and file are the same, then it's probably because there's ! # no pathname component. Set dirname to `.', the current directory. ! if test "z${directory}" = "z${command_line_filename}"; then ! directory=. ! fi ! ! # Source file might @include additional texinfo sources. Put `.' and ! # directory where source file(s) reside in TEXINPUTS before anything ! # else. `.' goes first to ensure that any old .aux, .cps, etc. files in ! # ${directory} don't get used in preference to fresher files in `.'. ! TEXINPUTS=".:${directory}:${TEXINPUTS_orig}" ! ! # Expand macro commands in the original source file using Makeinfo; ! # the macro syntax bfox implemented is impossible to implement in TeX. ! # Always use `end' footnote style, since the `separate' style ! # generates different output (arguably this is a bug in -E). ! # Discard main info output, the user asked to run TeX, not makeinfo. ! # Redirect output to /dev/null to throw away `Making info file...' msg. ! $verbose "Macro-expanding $command_line_filename to $filename_tmp ..." ! $makeinfo --footnote-style=end -E $filename_tmp -o /dev/null \ ! $command_line_filename >/dev/null ! ! # But if there were no macros, or makeinfo failed for some reason, ! # just use the original file. (It shouldn't make any difference, but ! # let's be safe.) ! if test $? -ne 0 || cmp -s $filename_tmp $command_line_filename; then ! $verbose "Reverting to $command_line_filename ..." ! cp -p $command_line_filename $filename_tmp ! fi ! filename_input=$filename_tmp ! dirname_input=$tmp_dir ! ! # Used most commonly for @finalout, @smallbook, etc. ! if test -n "$textra"; then ! $verbose "Inserting extra commands: $textra." ! sed '/^@setfilename/a\ ! '"$textra" $filename_input >$filename_tmp2 ! filename_input=$filename_tmp2 ! dirname_input=$tmp_dir2 ! fi ! ! # If clean mode was specified, then move to the temporary directory. ! if test "$clean" = t; then ! $verbose "cd $dirname_input" ! cd $dirname_input || exit 1 ! filename_input=`basename $filename_input` ! fi ! ! while true; do # will break out of loop below ! # "Unset" variables that might have values from previous iterations and ! # which won't be completely reset later. ! definite_index_files= ! ! # Find all files having root filename with a two-letter extension, ! # determine whether they're really index files, and save them. Foo.aux ! # is actually the cross-references file, but we need to keep track of ! # that too. ! possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`" ! for this_file in ${possible_index_files}; do # If file is empty, forget it. ! test -s "${this_file}" || continue ! # Examine first character of file. If it's not suitable to be an ! # index or xref file, don't process it. first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`" ! if test "x${first_character}" = "x\\" \ ! || test "x${first_character}" = "x'"; then ! definite_index_files="${definite_index_files} ${this_file}" fi ! done ! orig_index_files="${definite_index_files}" ! orig_index_files_sans_aux="`echo ${definite_index_files} \ ! | sed 's/'${filename_noext}'\.aux//; ! s/^[ ]*//;s/[ ]*$//;'`" ! ! # Now save copies of original index files so we have some means of ! # comparison later. ! $verbose "Backing up current index files: $orig_index_files ..." ! for index_file_to_save in ${orig_index_files}; do ! cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}" ! done ! ! # Run texindex on current index files. If they already exist, and ! # after running TeX a first time the index files don't change, then ! # there's no reason to run TeX again. But we won't know that if the ! # index files are out of date or nonexistent. ! if test -n "${orig_index_files_sans_aux}"; then ! $verbose "Running $texindex $orig_index_files_sans_aux ..." ${texindex} ${orig_index_files_sans_aux} ! fi ! # Finally, run TeX. ! if test "$batch" = t; then ! tex_mode='\nonstopmode' ! else ! tex_mode= ! fi ! $verbose "Running $tex $filename_input ..." ! cmd="$tex $tex_mode \\input $filename_input" ! $cmd ! ! # Check if index files changed. ! # ! definite_index_files= ! # Get list of new index files. ! possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`" ! for this_file in ${possible_index_files}; do ! # If file is empty, forget it. ! test -s "${this_file}" || continue ! ! # Examine first character of file. If it's not a backslash or ! # single quote, then it's definitely not an index or xref file. ! # (Will have to check for @ when we switch to Texinfo syntax in ! # all these files...) ! first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`" ! if test "x${first_character}" = "x\\" \ ! || test "x${first_character}" = "x'"; then ! definite_index_files="${definite_index_files} ${this_file}" ! fi ! done ! new_index_files="${definite_index_files}" ! new_index_files_sans_aux="`echo ${definite_index_files} \ ! | sed 's/'${filename_noext}'\.aux//; ! s/^[ ]*//;s/[ ]*$//;'`" ! ! # If old and new list don't at least have the same file list, then one ! # file or another has definitely changed. ! $verbose "Original index files =$orig_index_files" ! $verbose "New index files =$new_index_files" ! if test "z${orig_index_files}" != "z${new_index_files}"; then ! index_files_changed_p=t ! else ! # File list is the same. We must compare each file until we find a ! # difference. ! index_files_changed_p= ! for this_file in ${new_index_files}; do ! $verbose "Comparing index file $this_file ..." ! # cmp -s will return nonzero exit status if files differ. ! cmp -s "${this_file}" "${this_file}${backup_extension}" ! if test $? -ne 0; then ! # We only need to keep comparing until we find *one* that ! # differs, because we'll have to run texindex & tex no ! # matter what. ! index_files_changed_p=t ! $verbose "Index file $this_file differed:" ! test $verbose = echo \ ! && diff -c "${this_file}${backup_extension}" "${this_file}" ! break ! fi done ! fi ! # If index files have changed since TeX has been run, or if the aux ! # file wasn't present originally, run texindex and TeX again. ! if test "${index_files_changed_p}"; then :; else ! # Nothing changed. We're done with TeX. ! break ! fi ! done ! # If we were in clean mode, compilation was in a tmp directory. ! # Copy the DVI file into the directory where the compilation ! # has been done. (The temp dir is about to get removed anyway.) ! # We also return to the original directory so that ! # - the next file is processed in correct conditions ! # - the temporary file can be removed ! if test -n "$clean"; then ! $verbose "Copying DVI file from `pwd` to $orig_pwd" ! cp -p $filename_noext.dvi $orig_pwd ! cd $orig_pwd || exit 1 ! fi ! ! # Generate list of files to delete, then call rm once with the entire ! # list. This is significantly faster than multiple executions of rm. ! file_list= ! for file in ${orig_index_files}; do ! file_list="${file_list} ${file}${backup_extension}" ! done ! if test -n "${file_list}"; then ! $verbose "Removing $file_list $tmp_dir $tmp_dir2 ..." ! rm -f ${file_list} ! rm -rf $tmp_dir $tmp_dir2 ! fi done ! $verbose "$0 done." ! true # exit successfully. diff -aNrc2 bash-2.02.1/support/texi2html bash-2.03/support/texi2html *** bash-2.02.1/support/texi2html Tue Mar 3 14:30:51 1998 --- bash-2.03/support/texi2html Mon Apr 27 12:05:31 1998 *************** *** 1,3 **** ! #!/usr/bin/perl 'di '; 'ig 00 '; --- 1,3 ---- ! #!/usr/local/bin/perl 'di '; 'ig 00 '; *************** *** 10,14 **** #-############################################################################## ! # @(#)texi2html 1.51 09/10/96 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch # The man page for this program is included at the end of this file and can be --- 10,14 ---- #-############################################################################## ! # @(#)texi2html 1.52 01/05/98 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch # The man page for this program is included at the end of this file and can be *************** *** 30,34 **** $DEBUG_USER = 64; ! $BIBRE = '\[[\w\/]+\]'; # RE for a bibliography reference $FILERE = '[\/\w.+-]+'; # RE for a file name $VARRE = '[^\s\{\}]+'; # RE for a variable name --- 30,34 ---- $DEBUG_USER = 64; ! $BIBRE = '\[[\w\/-]+\]'; # RE for a bibliography reference $FILERE = '[\/\w.+-]+'; # RE for a file name $VARRE = '[^\s\{\}]+'; # RE for a variable name *************** *** 38,43 **** $ERROR = "***"; # prefix for errors and warnings ! $THISPROG = "texi2html 1.51"; # program name and version ! $HOMEPAGE = "http://wwwcn.cern.ch/dci/texi2html/"; # program home page $TODAY = &pretty_date; # like "20 September 1993" $SPLITTAG = "\n"; # tag to know where to split --- 38,43 ---- $ERROR = "***"; # prefix for errors and warnings ! $THISPROG = "texi2html 1.52"; # program name and version ! $HOMEPAGE = "http://wwwinfo.cern.ch/dis/texi2html/"; # program home page $TODAY = &pretty_date; # like "20 September 1993" $SPLITTAG = "\n"; # tag to know where to split *************** *** 130,133 **** --- 130,134 ---- "?", "?", ".", ".", + "-", "", ); *************** *** 160,165 **** 'code', 'CODE', 'ctrl', '&do_ctrl', # special case ! 'dfn', 'STRONG', # DFN tag is illegal in the standard 'dmn', '', # useless 'emph', 'EM', 'file', '"TT', # will put quotes, cf. &apply_style --- 161,167 ---- 'code', 'CODE', 'ctrl', '&do_ctrl', # special case ! 'dfn', 'EM', # DFN tag is illegal in the standard 'dmn', '', # useless + 'email', '&do_email', # insert a clickable email address 'emph', 'EM', 'file', '"TT', # will put quotes, cf. &apply_style *************** *** 167,170 **** --- 169,173 ---- 'kbd', 'KBD', 'key', 'KBD', + 'math', 'EM', 'r', '', # unsupported 'samp', '"SAMP', # will put quotes, cf. &apply_style *************** *** 173,176 **** --- 176,181 ---- 't', 'TT', 'titlefont', '', # useless + 'uref', '&do_uref', # insert a clickable URL + 'url', '&do_url', # insert a clickable URL 'var', 'VAR', 'w', '', # unsupported *************** *** 271,274 **** --- 276,280 ---- 'vskip', 1, 'filbreak', 1, + 'paragraphindent', 1, # unsupported formats 'cartouche', 1, *************** *** 284,287 **** --- 290,295 ---- #---############################################################################ + %value = (); # hold texinfo variables, see also -D + $use_bibliography = 1; $use_acc = 0; *************** *** 307,310 **** --- 315,319 ---- -glossary : handle a glossary -invisible name: use 'name' as an invisible anchor + -Dname : define name like with \@set -I dir : search also for files in 'dir' -menu : handle menus *************** *** 318,322 **** EOT ! while ($#ARGV >= 0 && $ARGV[0] =~ /^-/) { $_ = shift(@ARGV); if (/^-acc$/) { $use_acc = 1; next; } --- 327,331 ---- EOT ! while (@ARGV && $ARGV[0] =~ /^-/) { $_ = shift(@ARGV); if (/^-acc$/) { $use_acc = 1; next; } *************** *** 328,331 **** --- 337,341 ---- if (/^-i(nvisible)?$/) { $invisible_mark = shift(@ARGV); next; } if (/^-iso$/) { $use_iso = 1; next; } + if (/^-D(.+)?$/) { $value{$1 || shift(@ARGV)} = 1; next; } if (/^-I(.+)?$/) { push(@include_dirs, $1 || shift(@ARGV)); next; } if (/^-m(enu)?$/) { $show_menu = 1; next; } *************** *** 384,390 **** # variables # - %value = (); # hold texinfo variables $value{'html'} = 1; # predefine html (the output format) ! $value{'texi2html'} = '1.51'; # predefine texi2html (the translator) # _foo: internal to track @foo foreach ('_author', '_title', '_subtitle', --- 394,399 ---- # variables # $value{'html'} = 1; # predefine html (the output format) ! $value{'texi2html'} = '1.52'; # predefine texi2html (the translator) # _foo: internal to track @foo foreach ('_author', '_title', '_subtitle', *************** *** 454,458 **** $node = ''; # current node name $in_table = 0; # am I inside a table ! $table_type = ''; # type of table ('', 'f', 'v') @tables = (); # nested table support $in_bibliography = 0; # am I inside a bibliography --- 463,467 ---- $node = ''; # current node name $in_table = 0; # am I inside a table ! $table_type = ''; # type of table ('', 'f', 'v', 'multi') @tables = (); # nested table support $in_bibliography = 0; # am I inside a bibliography *************** *** 555,561 **** s/((^|[^\@])(\@\@)*)\@c(omment)? .*/$1/; # non-@ substitutions cf. texinfmt.el ! s/``/\"/g; ! s/''/\"/g; ! s/([\w ])---([\w ])/$1--$2/g; # # analyze the tag --- 564,572 ---- s/((^|[^\@])(\@\@)*)\@c(omment)? .*/$1/; # non-@ substitutions cf. texinfmt.el ! unless ($in_pre) { ! s/``/\"/g; ! s/''/\"/g; ! s/([\w ])---([\w ])/$1--$2/g; ! } # # analyze the tag *************** *** 571,582 **** &skip_until($tag), next if $tag eq 'tex'; # handle special tables ! if ($tag eq 'table') { ! $table_type = ''; ! } elsif ($tag eq 'ftable') { $tag = 'table'; - $table_type = 'f'; - } elsif ($tag eq 'vtable') { - $tag = 'table'; - $table_type = 'v'; } # special cases --- 582,588 ---- &skip_until($tag), next if $tag eq 'tex'; # handle special tables ! if ($tag =~ /^(|f|v|multi)table$/) { ! $table_type = $1; $tag = 'table'; } # special cases *************** *** 648,656 **** next; } elsif ($tag eq 'table') { ! if (/^\@[fv]?table\s+\@(\w+)\s*$/) { ! $in_table = $1; unshift(@tables, join($;, $table_type, $in_table)); ! push(@lines, &debug("
\n", __LINE__)); ! &html_push_if('DL'); push(@lines, &html_debug("\n", __LINE__)); } else { --- 654,667 ---- next; } elsif ($tag eq 'table') { ! if (/^\@(|f|v|multi)table\s+\@(\w+)/) { ! $in_table = $2; unshift(@tables, join($;, $table_type, $in_table)); ! if ($table_type eq "multi") { ! push(@lines, &debug("\n", __LINE__)); ! &html_push_if('TABLE'); ! } else { ! push(@lines, &debug("
\n", __LINE__)); ! &html_push_if('DL'); ! } push(@lines, &html_debug("\n", __LINE__)); } else { *************** *** 777,784 **** push(@lines, &debug("\n", __LINE__)); push(@lines, &html_debug("\n", __LINE__)); ! } elsif ($end_tag eq 'table' || ! $end_tag eq 'ftable' || ! $end_tag eq 'vtable') { ! shift(@tables); if (@tables) { ($table_type, $in_table) = split($;, $tables[0]); --- 788,809 ---- push(@lines, &debug("\n", __LINE__)); push(@lines, &html_debug("\n", __LINE__)); ! } elsif ($end_tag =~ /^(|f|v|multi)table$/) { ! unless (@tables) { ! warn "$ERROR \@end $end_tag without \@*table\n"; ! next; ! } ! ($table_type, $in_table) = split($;, shift(@tables)); ! unless ($1 eq $table_type) { ! warn "$ERROR \@end $end_tag without matching \@$end_tag\n"; ! next; ! } ! if ($table_type eq "multi") { ! push(@lines, "
\n"); ! &html_pop_if('TR'); ! } else { ! push(@lines, "
\n"); ! &html_pop_if('DD'); ! } ! &html_pop_if(); if (@tables) { ($table_type, $in_table) = split($;, $tables[0]); *************** *** 786,792 **** $in_table = 0; } - push(@lines, "\n"); - &html_pop_if('DD'); - &html_pop_if(); } elsif (defined($def_map{$end_tag})) { push(@lines, &debug("\n", __LINE__)); --- 811,814 ---- *************** *** 987,990 **** --- 1009,1018 ---- unshift(@input_spool, "\@${table_type}index $what\n"); } + } elsif ($html_element eq 'TABLE') { + push(@lines, &debug("$what\n", __LINE__)); + &html_push('TR'); + } elsif ($html_element eq 'TR') { + push(@lines, &debug("\n", __LINE__)); + push(@lines, &debug("$what\n", __LINE__)); } else { push(@lines, &debug("
  • $what\n", __LINE__)); *************** *** 997,1000 **** --- 1025,1031 ---- } next; + } elsif (/^\@tab\s+(.*)$/) { + push(@lines, "$1\n"); + next; } } *************** *** 1089,1092 **** --- 1120,1135 ---- if $key ne $_ && $debug & $DEBUG_INDEX; } + push(@lines2, "Jump to:\n"); + $last_letter = undef; + foreach $key (sort byalpha @keys) { + $letter = substr($key2alpha{$key}, 0, 1); + $letter = substr($key2alpha{$key}, 0, 2) if $letter eq $;; + if (!defined($last_letter) || $letter ne $last_letter) { + push(@lines2, "-\n") if defined($last_letter); + push(@lines2, "" . &protect_html($letter) . "\n"); + $last_letter = $letter; + } + } + push(@lines2, "

    \n"); $last_letter = undef; foreach $key (sort byalpha @keys) { *************** *** 1095,1099 **** if (!defined($last_letter) || $letter ne $last_letter) { push(@lines2, "\n") if defined($last_letter); ! push(@lines2, "

    " . &protect_html($letter) . "

    \n"); push(@lines2, "\n"); $last_letter = $letter; --- 1138,1142 ---- if (!defined($last_letter) || $letter ne $last_letter) { push(@lines2, "\n") if defined($last_letter); ! push(@lines2, "

    " . &protect_html($letter) . "

    \n"); push(@lines2, "\n"); $last_letter = $letter; *************** *** 1658,1663 **** --- 1701,1722 ---- sub do_ctrl { "^$_[0]" } + sub do_email { + local($addr, $text) = split(/,\s*/, $_[0]); + + $text = $addr unless $text; + &anchor('', "mailto:$addr", $text); + } + sub do_sc { "\U$_[0]\E" } + sub do_uref { + local($url, $text) = split(/,\s*/, $_[0]); + + $text = $url unless $text; + &anchor('', $url, $text); + } + + sub do_url { &anchor('', $_[0], $_[0]) } + sub apply_style { local($texi_style, $text) = @_; *************** *** 1823,1827 **** This document was generated on $TODAY using the texi2html ! translator version 1.51.

    EOT &print_footer; --- 1882,1886 ---- This document was generated on $TODAY using the texi2html ! translator version 1.52.

    EOT &print_footer; *************** *** 1880,1884 **** .nr % 0 \" start at page 1 '; __END__ ############# From here on it's a standard manual page ############ ! .TH TEXI2HTML 1 "09/10/96" .AT 3 .SH NAME --- 1939,1943 ---- .nr % 0 \" start at page 1 '; __END__ ############# From here on it's a standard manual page ############ ! .TH TEXI2HTML 1 "01/05/98" .AT 3 .SH NAME *************** *** 1925,1930 **** .TP .B \-invisible \fIname\fP ! Use \fIname\fP to create invisible destination anchors for index links. This is a workaround ! for a known bug of many WWW browsers, including xmosaic. .TP .B \-I \fIdir\fP --- 1984,1990 ---- .TP .B \-invisible \fIname\fP ! Use \fIname\fP to create invisible destination anchors for index links ! (you can for instance use the invisible.xbm file shipped with this program). ! This is a workaround for a known bug of many WWW browsers, including netscape. .TP .B \-I \fIdir\fP *************** *** 1986,2004 **** .SH ADDITIONAL COMMANDS .I texi2html ! implements the following non-Texinfo commands: .TP 16 .B @ifhtml This indicates the start of an HTML section, this section will passed through ! without any modofication. .TP .B @end ifhtml ! This indcates the end of an HTML section. .SH VERSION ! This is \fItexi2html\fP version 1.51, 09/10/96. .PP The latest version of \fItexi2html\fP can be found in WWW, cf. URL ! http://wwwcn.cern.ch/dci/texi2html/ .SH AUTHOR ! The main author is Lionel Cons, CERN CN/DCI/UWS, Lionel.Cons@cern.ch. Many other people around the net contributed to this program. .SH COPYRIGHT --- 2046,2064 ---- .SH ADDITIONAL COMMANDS .I texi2html ! implements the following non-Texinfo commands (maybe they are in Texinfo now...): .TP 16 .B @ifhtml This indicates the start of an HTML section, this section will passed through ! without any modification. .TP .B @end ifhtml ! This indicates the end of an HTML section. .SH VERSION ! This is \fItexi2html\fP version 1.52, 01/05/98. .PP The latest version of \fItexi2html\fP can be found in WWW, cf. URL ! http://wwwinfo.cern.ch/dis/texi2html/ .SH AUTHOR ! The main author is Lionel Cons, CERN IT/DIS/OSE, Lionel.Cons@cern.ch. Many other people around the net contributed to this program. .SH COPYRIGHT diff -aNrc2 bash-2.02.1/test.c bash-2.03/test.c *** bash-2.02.1/test.c Tue Sep 23 13:03:26 1997 --- bash-2.03/test.c Mon Nov 2 16:21:07 1998 *************** *** 99,102 **** --- 99,104 ---- #define SHELL_BOOLEAN(value) (!(value)) + #define TEST_ERREXIT_STATUS 2 + static procenv_t test_exit_buf; static int test_error_return; *************** *** 143,147 **** fprintf (stderr, "\n"); fflush (stderr); ! test_exit (SHELL_BOOLEAN (FALSE)); } --- 145,149 ---- fprintf (stderr, "\n"); fflush (stderr); ! test_exit (TEST_ERREXIT_STATUS); } diff -aNrc2 bash-2.02.1/tests/cprint.right bash-2.03/tests/cprint.right *** bash-2.02.1/tests/cprint.right Wed Dec 31 19:00:00 1969 --- bash-2.03/tests/cprint.right Thu Feb 18 11:23:13 1999 *************** *** 0 **** --- 1,72 ---- + tf is a function + tf () + { + echo this is ${0##*/} >/dev/null; + echo a | cat - >/dev/null; + test -f ${0##*/} && echo ${0##*/} is a regular file; + test -d ${0##*/} || echo ${0##*/} is not a directory; + echo a; + echo b; + echo c; + echo background >/dev/null & ( exit 1 ); + echo $?; + { + echo a + }; + i=0; + while (( " i < 3 " )); do + test -r /dev/fd/$i; + i=$(( i + 1 )); + done; + [[ -r /dev/fd/0 && -w /dev/fd/1 ]] || echo oops >/dev/null; + for name in $( echo 1 2 3 ); + do + test -r /dev/fd/$name; + done; + if [[ -r /dev/fd/0 && -w /dev/fd/1 ]]; then + echo ok >/dev/null; + else + if (( " 7 > 40 " )); then + echo oops; + else + echo done; + fi; + fi >/dev/null; + case $PATH in + *$PWD*) + echo \$PWD in \$PATH + ;; + *) + echo \$PWD not in \$PATH + ;; + esac >/dev/null; + while false; do + echo z; + done >/dev/null; + until true; do + echo z; + done >/dev/null; + echo \&\|'()' \{ echo abcde \; \}; + eval fu\%nc'()' \{ echo abcde \; \}; + type fu\%nc + } + tf2 is a function + tf2 () + { + ( { + time -p echo a | cat - >/dev/null + } ) 2>&1 + } + cprint.tests is a regular file + cprint.tests is not a directory + a + b + c + 1 + a + &|() { echo abcde ; } + fu%nc is a function + fu%nc () + { + echo abcde + } diff -aNrc2 bash-2.02.1/tests/cprint.tests bash-2.03/tests/cprint.tests *** bash-2.02.1/tests/cprint.tests Wed Dec 31 19:00:00 1969 --- bash-2.03/tests/cprint.tests Thu Feb 18 11:23:01 1999 *************** *** 0 **** --- 1,67 ---- + # + # a nonsense script and shell function to test out the command printing code + # + tf() + { + # simple command with redir + echo this is ${0##*/} > /dev/null + + # pipeline + echo a | cat - > /dev/null + + test -f ${0##*/} && echo ${0##*/} is a regular file + test -d ${0##*/} || echo ${0##*/} is not a directory + + echo a ; echo b ; echo c + + echo background >/dev/null & + + ( exit 1 ) + echo $? + + { echo a ; } + + i=0 + while (( i < 3 )); do + test -r /dev/fd/$i + i=$(( i + 1 )) + done + + [[ -r /dev/fd/0 && -w /dev/fd/1 ]] || echo oops > /dev/null + + for name in $( echo 1 2 3 ); do + test -r /dev/fd/$name + done + + if [[ -r /dev/fd/0 && -w /dev/fd/1 ]] ; then + echo ok > /dev/null + elif (( 7 > 40 )) ; then + echo oops + else + echo done + fi > /dev/null + + case $PATH in + *$PWD*) echo \$PWD in \$PATH ;; + *) echo \$PWD not in \$PATH ;; + esac > /dev/null + + while false; do echo z; done > /dev/null + + until true; do echo z ; done > /dev/null + + echo \&\|'()' \{ echo abcde \; \} + # when not in POSIX mode, we can have weirdly-named functions + eval fu\%nc'()' \{ echo abcde \; \} + type fu\%nc + } + + tf2() + { + ( { time -p echo a | cat - > /dev/null ; } ) 2>&1 + } + + type tf + type tf2 + + tf diff -aNrc2 bash-2.02.1/tests/extglob.right bash-2.03/tests/extglob.right *** bash-2.02.1/tests/extglob.right Thu Aug 7 14:11:58 1997 --- bash-2.03/tests/extglob.right Tue Dec 15 13:34:09 1998 *************** *** 58,59 **** --- 58,78 ---- 6: ef 7: abcdef + ab abef + abcfef abef + abcdef + ab abcdef abcfef abef + abcdef abcfef abef + ok 37 + ok 38 + ok 39 + ok 40 + ok 41 + a b a,b a-b a.b a:b a;b a_b + a b a,b a-b a.b a:b a;b a_b + a b a,b a-b a.b a:b a;b a_b + a b a,b a-b a.b a:b a;b a_b + a.b + a b a,b a-b a:b a;b a_b + a b a,b a-b a.b a:b a;b a_b + a b a,b a-b a.b a:b a;b a_b + a b a,b a-b a.b a:b a;b a_b diff -aNrc2 bash-2.02.1/tests/extglob.tests bash-2.03/tests/extglob.tests *** bash-2.02.1/tests/extglob.tests Wed Aug 6 15:50:55 1997 --- bash-2.03/tests/extglob.tests Tue Dec 15 13:33:28 1998 *************** *** 275,279 **** echo 7: ${x#"*(a|b)cd"} ! # clean up and exit builtin cd / --- 275,346 ---- echo 7: ${x#"*(a|b)cd"} ! # More tests derived from a bug report concerning extended glob patterns ! # following a * ! builtin cd $TESTDIR || { echo $0: cannot cd to $TESTDIR >&2 ; exit 1; } ! rm -rf * ! ! touch ab abcdef abef abcfef ! ! expect 'ab abef' ! echo ab*(e|f) ! ! expect 'abcfef abef' ! echo ab?*(e|f) ! ! expect abcdef ! echo ab*d+(e|f) ! ! expect 'ab abcdef abcfef abef' ! echo ab**(e|f) ! ! expect 'abcdef abcfef abef' ! echo ab*+(e|f) ! ! case 'abcfefg' in ! ab**(e|f)) echo ok 37;; ! *) echo bad 37;; ! esac ! ! case 'abcfefg' in ! ab**(e|f)g) echo ok 38;; ! *a) echo bad 38;; ! esac ! ! case ab in ! ab*+(e|f)) echo bad 39;; ! *) echo ok 39;; ! esac ! ! case abef in ! ab***ef) echo ok 40;; ! *) echo bad 40;; ! esac ! ! case abef in ! ab**) echo ok 41;; ! *) echo bad 41;; ! esac ! ! # clean up and do the next one ! ! builtin cd / ! rm -rf $TESTDIR ! ! mkdir $TESTDIR ! builtin cd $TESTDIR ! ! touch a.b a,b a:b a-b a\;b a\ b a_b ! ! echo a[^[:alnum:]]b ! echo a[-.,:\;\ _]b ! ! echo a@([^[:alnum:]])b ! echo a@([-.,:; _])b ! echo a@([.])b ! echo a@([^.])b ! echo a@([^x])b ! echo a+([^[:alnum:]])b ! ! echo a@(.|[^[:alnum:]])b builtin cd / diff -aNrc2 bash-2.02.1/tests/more-exp.right bash-2.03/tests/more-exp.right *** bash-2.02.1/tests/more-exp.right Wed Aug 20 17:01:44 1997 --- bash-2.03/tests/more-exp.right Mon Sep 28 12:02:34 1998 *************** *** 193,194 **** --- 193,204 ---- ./more-exp.tests: #: %: syntax error: operand expected (error token is "%") argv[1] = <0> + argv[1] = + argv[1] = <+> + argv[1] = <+> + argv[1] = <+> + argv[1] = + argv[2] = + argv[3] = <}> + argv[1] = + argv[2] = + argv[3] = <}> diff -aNrc2 bash-2.02.1/tests/more-exp.tests bash-2.03/tests/more-exp.tests *** bash-2.02.1/tests/more-exp.tests Wed Aug 20 17:04:59 1997 --- bash-2.03/tests/more-exp.tests Mon Sep 28 12:01:32 1998 *************** *** 435,436 **** --- 435,462 ---- expect '<0>' recho ${#:-} + + set -- + unset a b + + x=a + y=b + + IFS=+ + + expect '' + recho $x+$y + expect '<+>' + recho $a+$b + + expect '<+>' + recho + "$@" + expect '<+>' + recho +"$@" + + expect '' '' '<}>' + recho ${gik:-G { I } K } + + abc=hi + + expect '' '' '<}>' + recho ${abc:-G { I } K } diff -aNrc2 bash-2.02.1/tests/printf.right bash-2.03/tests/printf.right *** bash-2.02.1/tests/printf.right Fri Jan 30 13:09:50 1998 --- bash-2.03/tests/printf.right Wed Apr 29 15:46:54 1998 *************** *** 33,36 **** --- 33,38 ---- ---- --4.2 + + 4.4BSD 4.4BSD diff -aNrc2 bash-2.02.1/tests/printf.tests bash-2.03/tests/printf.tests *** bash-2.02.1/tests/printf.tests Fri Jan 30 13:08:00 1998 --- bash-2.03/tests/printf.tests Wed Apr 29 15:47:06 1998 *************** *** 84,87 **** --- 84,92 ---- printf -- "--%b--\n" '4.2\c5.4\n'; printf "\n" + # make sure extra arguments are ignored if the format string doesn't + # actually use them + printf "\n" 4.4 BSD + printf " " 4.4 BSD ; printf "\n" + # make sure that a fieldwidth and precision of `*' are handled right printf "%10.8s\n" 4.4BSD diff -aNrc2 bash-2.02.1/tests/run-cprint bash-2.03/tests/run-cprint *** bash-2.02.1/tests/run-cprint Wed Dec 31 19:00:00 1969 --- bash-2.03/tests/run-cprint Wed Feb 3 09:33:27 1999 *************** *** 0 **** --- 1,2 ---- + ${THIS_SH} ./cprint.tests > /tmp/xx 2>&1 + diff /tmp/xx cprint.right && rm -f /tmp/xx diff -aNrc2 bash-2.02.1/tests/run-printf bash-2.03/tests/run-printf *** bash-2.02.1/tests/run-printf Wed Aug 13 16:53:57 1997 --- bash-2.03/tests/run-printf Wed Apr 29 15:41:28 1998 *************** *** 1,2 **** ${THIS_SH} ./printf.tests > /tmp/xx 2>&1 ! diff /tmp/xx printf.right && rm -f /tmp/xx --- 1,5 ---- + # See whether or not we can use `diff -a' + ( diff -a ./printf.tests ./printf.tests >/dev/null 2>&1 ) && AFLAG=-a + ${THIS_SH} ./printf.tests > /tmp/xx 2>&1 ! diff $AFLAG /tmp/xx printf.right && rm -f /tmp/xx diff -aNrc2 bash-2.02.1/tests/shopt.right bash-2.03/tests/shopt.right *** bash-2.02.1/tests/shopt.right Thu Nov 20 12:00:33 1997 --- bash-2.03/tests/shopt.right Thu Sep 3 15:16:28 1998 *************** *** 22,25 **** --- 22,26 ---- shopt -u nullglob shopt -s promptvars + shopt -u restricted_shell shopt -u shift_verbose shopt -s sourcepath *************** *** 51,54 **** --- 52,56 ---- shopt -u nocaseglob shopt -u nullglob + shopt -u restricted_shell shopt -u shift_verbose -- *************** *** 67,70 **** --- 69,73 ---- nocaseglob off nullglob off + restricted_shell off shift_verbose off -- diff -aNrc2 bash-2.02.1/tests/test.right bash-2.03/tests/test.right *** bash-2.02.1/tests/test.right Tue Nov 18 12:14:28 1997 --- bash-2.03/tests/test.right Tue Nov 10 12:40:18 1998 *************** *** 223,266 **** t 4+3 -eq 7 ./test-tests: test: 4+3: integer expression expected ! 1 b 4-5 -eq 7 ./test-tests: [: 4+3: integer expression expected ! 1 t 9 -eq 4+5 ./test-tests: test: 4+5: integer expression expected ! 1 b 9 -eq 4+5 ./test-tests: [: 4+5: integer expression expected ! 1 t A -eq 7 ./test-tests: test: A: integer expression expected ! 1 b A -eq 7 ./test-tests: [: A: integer expression expected ! 1 t 9 -eq B ./test-tests: test: B: integer expression expected ! 1 b 9 -eq B ./test-tests: [: B: integer expression expected ! 1 t ( 1 = 2 ./test-tests: test: `)' expected ! 1 b ( 1 = 2 ./test-tests: [: `)' expected, found ] ! 1 ./test-tests: test: a: unary operator expected ! 1 ./test-tests: test: b: binary operator expected ! 1 ./test-tests: test: -A: unary operator expected ! 1 ./test-tests: test: too many arguments ! 1 ./test-tests: test: too many arguments ! 1 ./test-tests: [: missing `]' ! 1 ./test-tests: test: (: unary operator expected ! 1 --- 223,266 ---- t 4+3 -eq 7 ./test-tests: test: 4+3: integer expression expected ! 2 b 4-5 -eq 7 ./test-tests: [: 4+3: integer expression expected ! 2 t 9 -eq 4+5 ./test-tests: test: 4+5: integer expression expected ! 2 b 9 -eq 4+5 ./test-tests: [: 4+5: integer expression expected ! 2 t A -eq 7 ./test-tests: test: A: integer expression expected ! 2 b A -eq 7 ./test-tests: [: A: integer expression expected ! 2 t 9 -eq B ./test-tests: test: B: integer expression expected ! 2 b 9 -eq B ./test-tests: [: B: integer expression expected ! 2 t ( 1 = 2 ./test-tests: test: `)' expected ! 2 b ( 1 = 2 ./test-tests: [: `)' expected, found ] ! 2 ./test-tests: test: a: unary operator expected ! 2 ./test-tests: test: b: binary operator expected ! 2 ./test-tests: test: -A: unary operator expected ! 2 ./test-tests: test: too many arguments ! 2 ./test-tests: test: too many arguments ! 2 ./test-tests: [: missing `]' ! 2 ./test-tests: test: (: unary operator expected ! 2 diff -aNrc2 bash-2.02.1/tests/type.right bash-2.03/tests/type.right *** bash-2.02.1/tests/type.right Wed Nov 12 15:01:29 1997 --- bash-2.03/tests/type.right Wed May 13 16:12:49 1998 *************** *** 1,3 **** ! ./type.tests: type: unknown option: f type: usage: type [-apt] name [name ...] ./type.tests: type: notthere: not found --- 1,3 ---- ! ./type.tests: type: illegal option: -f type: usage: type [-apt] name [name ...] ./type.tests: type: notthere: not found diff -aNrc2 bash-2.02.1/trap.c bash-2.03/trap.c *** bash-2.02.1/trap.c Wed Mar 25 12:16:09 1998 --- bash-2.03/trap.c Thu Oct 22 13:39:06 1998 *************** *** 117,120 **** --- 117,125 ---- sigmodes[SIGINT] |= SIG_SPECIAL; + #if defined (__BEOS__) + /* BeOS sets SIGINT to SIG_IGN! */ + original_signals[SIGINT] = SIG_DFL; + #endif + original_signals[SIGQUIT] = (SigHandler *) set_signal_handler (SIGQUIT, SIG_DFL); *************** *** 160,167 **** /* A leading `SIG' may be omitted. */ for (sig = 0; sig <= NSIG; sig++) ! if (strcasecmp (string, signal_names[sig]) == 0 || ! (STREQN (signal_names[sig], "SIG", 3) && ! strcasecmp (string, &(signal_names[sig])[3]) == 0)) ! return ((int)sig); return (NO_SIG); --- 165,176 ---- /* A leading `SIG' may be omitted. */ for (sig = 0; sig <= NSIG; sig++) ! { ! if (signal_names[sig] == 0 || signal_names[sig][0] == '\0') ! continue; ! if (strcasecmp (string, signal_names[sig]) == 0 || ! (STREQN (signal_names[sig], "SIG", 3) && ! strcasecmp (string, &(signal_names[sig])[3]) == 0)) ! return ((int)sig); ! } return (NO_SIG); diff -aNrc2 bash-2.02.1/variables.c bash-2.03/variables.c *** bash-2.02.1/variables.c Tue Mar 24 13:00:21 1998 --- bash-2.03/variables.c Tue Nov 10 13:29:45 1998 *************** *** 250,253 **** --- 250,259 ---- } + /* According to the Single Unix Specification, v2, $OLDPWD is an + `environment variable' and therefore should be auto-exported. + Make a dummy invisible variable for OLDPWD, and mark it as exported. */ + temp_var = bind_variable ("OLDPWD", (char *)NULL); + temp_var->attributes |= (att_exported | att_invisible); + /* Set up initial value of $_ */ temp_var = bind_variable ("_", dollar_vars[0]); *************** *** 277,281 **** --- 283,293 ---- if (interactive_shell) { + #if defined (PROMPT_STRING_DECODE) set_if_not ("PS1", primary_prompt); + #else + if (current_user.uid == -1) + get_current_user_info (); + set_if_not ("PS1", current_user.euid == 0 ? "# " : primary_prompt); + #endif set_if_not ("PS2", secondary_prompt); } *************** *** 305,316 **** initialize_shell_level (); ! /* Make a variable $PPID, which holds the pid of the shell's parent. */ ! name = itos ((int) getppid ()); ! temp_var = find_variable ("PPID"); ! if (temp_var) ! temp_var->attributes &= ~(att_readonly | att_exported); ! temp_var = bind_variable ("PPID", name); ! temp_var->attributes |= (att_readonly | att_integer); ! free (name); /* Initialize the `getopts' stuff. */ --- 317,321 ---- initialize_shell_level (); ! set_ppid (); /* Initialize the `getopts' stuff. */ *************** *** 396,399 **** --- 401,415 ---- /* Set $HOME to the information in the password file if we didn't get it from the environment. */ + + /* This function is not static so the tilde and readline libraries can + use it. */ + char * + get_home_dir () + { + if (current_user.home_dir == 0) + get_current_user_info (); + return current_user.home_dir; + } + static void set_home_var () *************** *** 403,411 **** temp_var = find_variable ("HOME"); if (temp_var == 0) ! { ! if (current_user.home_dir == 0) ! get_current_user_info (); ! temp_var = bind_variable ("HOME", current_user.home_dir); ! } temp_var->attributes |= att_exported; } --- 419,423 ---- temp_var = find_variable ("HOME"); if (temp_var == 0) ! temp_var = bind_variable ("HOME", get_home_dir ()); temp_var->attributes |= att_exported; } *************** *** 553,575 **** } static void uidset () { ! char *buff; register SHELL_VAR *v; ! buff = itos (current_user.uid); v = find_variable ("UID"); if (v) v->attributes &= ~att_readonly; ! v = bind_variable ("UID", buff); v->attributes |= (att_readonly | att_integer); if (current_user.euid != current_user.uid) ! { ! free (buff); ! buff = itos (current_user.euid); ! } v = find_variable ("EUID"); --- 565,599 ---- } + /* Make a variable $PPID, which holds the pid of the shell's parent. */ + void + set_ppid () + { + char namebuf[32], *name; + SHELL_VAR *temp_var; + + name = inttostr ((int) getppid (), namebuf, sizeof(namebuf)); + temp_var = find_variable ("PPID"); + if (temp_var) + temp_var->attributes &= ~(att_readonly | att_exported); + temp_var = bind_variable ("PPID", name); + temp_var->attributes |= (att_readonly | att_integer); + } + static void uidset () { ! char buff[32], *b; register SHELL_VAR *v; ! b = inttostr (current_user.uid, buff, sizeof (buff)); v = find_variable ("UID"); if (v) v->attributes &= ~att_readonly; ! v = bind_variable ("UID", b); v->attributes |= (att_readonly | att_integer); if (current_user.euid != current_user.uid) ! b = inttostr (current_user.euid, buff, sizeof (buff)); v = find_variable ("EUID"); *************** *** 577,583 **** v->attributes &= ~att_readonly; ! v = bind_variable ("EUID", buff); v->attributes |= (att_readonly | att_integer); - free (buff); } --- 601,606 ---- v->attributes &= ~att_readonly; ! v = bind_variable ("EUID", b); v->attributes |= (att_readonly | att_integer); } *************** *** 588,592 **** SHELL_VAR *vv; ARRAY *av; ! char *s, d[16]; makunbound ("BASH_VERSINFO", shell_variables); --- 611,615 ---- SHELL_VAR *vv; ARRAY *av; ! char *s, d[32]; makunbound ("BASH_VERSINFO", shell_variables); *************** *** 600,609 **** array_add_element (av, 0, d); array_add_element (av, 1, s); ! s = itos (patch_level); array_add_element (av, 2, s); ! free (s); ! s = itos (build_version); array_add_element (av, 3, s); - free (s); array_add_element (av, 4, release_status); array_add_element (av, 5, MACHTYPE); --- 623,630 ---- array_add_element (av, 0, d); array_add_element (av, 1, s); ! s = inttostr (patch_level, d, sizeof (d)); array_add_element (av, 2, s); ! s = inttostr (build_version, d, sizeof (d)); array_add_element (av, 3, s); array_add_element (av, 4, release_status); array_add_element (av, 5, MACHTYPE); *************** *** 619,631 **** int lines, cols; { ! char *val; ! val = itos (lines); ! bind_variable ("LINES", val); ! free (val); ! ! val = itos (cols); ! bind_variable ("COLUMNS", val); ! free (val); } --- 640,650 ---- int lines, cols; { ! char val[32], *v; ! ! v = inttostr (lines, val, sizeof (val)); ! bind_variable ("LINES", v); ! v = inttostr (cols, val, sizeof (val)); ! bind_variable ("COLUMNS", v); } *************** *** 1172,1175 **** --- 1191,1202 ---- } + /* This is present for use by the tilde and readline libraries. */ + char * + get_env_value (v) + char *v; + { + return get_string_value (v); + } + /* Create a local variable referenced by NAME. */ SHELL_VAR * *************** *** 1529,1534 **** /* Expand the value string into a list of words, performing all the ! shell expansions including word splitting. */ ! #if 1 /* First we split the string on whitespace, using the shell parser (ksh93 seems to do this). */ --- 1556,1560 ---- /* Expand the value string into a list of words, performing all the ! shell expansions including pathname generation and word splitting. */ /* First we split the string on whitespace, using the shell parser (ksh93 seems to do this). */ *************** *** 1536,1545 **** /* Now that we've split it, perform the shell expansions on each word in the list. */ nlist = list ? expand_words_shellexp (list) : (WORD_LIST *)NULL; - dispose_words (list); #else ! nlist = expand_string (val, 0); #endif if (val != value) free (val); --- 1562,1573 ---- /* Now that we've split it, perform the shell expansions on each word in the list. */ + #if 0 nlist = list ? expand_words_shellexp (list) : (WORD_LIST *)NULL; #else ! nlist = list ? expand_words_no_vars (list) : (WORD_LIST *)NULL; #endif + dispose_words (list); + if (val != value) free (val); *************** *** 2510,2513 **** --- 2538,2565 ---- } + /* This is an efficiency hack. PWD and OLDPWD are auto-exported, so + we will need to remake the exported environment every time we + change directories. `_' is always put into the environment for + every external command, so without special treatment it will always + cause the environment to be remade. + + If there is no other reason to make the exported environment, we can + just update the variables in place and mark the exported environment + as no longer needing a remake. */ + void + update_export_env_inplace (env_prefix, preflen, value) + char *env_prefix; + int preflen; + char *value; + { + char *evar; + + evar = xmalloc (STRLEN (value) + preflen + 1); + strcpy (evar, env_prefix); + if (value) + strcpy (evar + preflen, value); + export_env = add_or_supercede_exported_var (evar, 0); + } + /* We always put _ in the environment as the name of this command. */ void *************** *** 2515,2527 **** char *command_name; { ! char *dummy; ! ! dummy = xmalloc (4 + strlen (command_name)); ! ! /* These three statements replace a call to sprintf */ ! dummy[0] = '_'; ! dummy[1] = '='; ! strcpy (dummy + 2, command_name); ! export_env = add_or_supercede_exported_var (dummy, 0); } --- 2567,2571 ---- char *command_name; { ! update_export_env_inplace ("_=", 2, command_name); } *************** *** 2921,2925 **** ARRAY *a; register int i; ! char *t; v = find_variable ("PIPESTATUS"); --- 2965,2969 ---- ARRAY *a; register int i; ! char *t, tbuf[16]; v = find_variable ("PIPESTATUS"); *************** *** 2933,2939 **** for (i = 0; ps[i] != -1; i++) { ! t = itos (ps[i]); array_add_element (a, i, t); - free (t); } } --- 2977,2982 ---- for (i = 0; ps[i] != -1; i++) { ! t = inttostr (ps[i], tbuf, sizeof (tbuf)); array_add_element (a, i, t); } } diff -aNrc2 bash-2.02.1/variables.h bash-2.03/variables.h *** bash-2.02.1/variables.h Wed Oct 29 15:31:29 1997 --- bash-2.03/variables.h Tue Nov 10 13:30:19 1998 *************** *** 10,13 **** --- 10,20 ---- #include "hashlib.h" + /* Placeholder for future modifications if cross-compiling or building a + `fat' binary, e.g. on Apple Rhapsody. These values are used in multiple + files, so they appear here. */ + #define HOSTTYPE CONF_HOSTTYPE + #define OSTYPE CONF_OSTYPE + #define MACHTYPE CONF_MACHTYPE + /* What a shell variable looks like. */ *************** *** 70,73 **** --- 77,82 ---- extern void set_lines_and_columns __P((int, int)); + extern void set_ppid __P((void)); + extern SHELL_VAR *find_function __P((char *)); extern SHELL_VAR *find_variable __P((char *)); *************** *** 113,116 **** --- 122,126 ---- extern void sort_variables __P((SHELL_VAR **)); extern void maybe_make_export_env __P((void)); + extern void update_export_env_inplace __P((char *, int, char *)); extern void put_command_name_into_env __P((char *)); extern void put_gnu_argv_flags_into_env __P((int, char *)); diff -aNrc2 bash-2.02.1/version.c bash-2.03/version.c *** bash-2.02.1/version.c Tue Mar 17 12:30:24 1998 --- bash-2.03/version.c Thu Feb 4 15:13:07 1999 *************** *** 55,59 **** #if !defined (MACHTYPE) ! # define MACHTYPE "unknown" #endif --- 55,63 ---- #if !defined (MACHTYPE) ! # if defined (CONF_MACHTYPE) ! # define MACHTYPE CONF_MACHTYPE ! # else ! # define MACHTYPE "unknown" ! # endif #endif diff -aNrc2 bash-2.02.1/xmalloc.c bash-2.03/xmalloc.c *** bash-2.02.1/xmalloc.c Mon Feb 17 14:28:29 1997 --- bash-2.03/xmalloc.c Thu Feb 18 11:54:40 1999 *************** *** 47,51 **** #endif /* !PTR_T */ ! #if !defined (SBRK_DECLARED) extern char *sbrk(); #endif --- 47,51 ---- #endif /* !PTR_T */ ! #if defined (HAVE_SBRK) && !defined (SBRK_DECLARED) extern char *sbrk(); #endif *************** *** 61,64 **** --- 61,77 ---- /* **************************************************************** */ + #if defined (HAVE_SBRK) + static size_t + findbrk () + { + if (brkfound == 0) + { + lbreak = (PTR_T)sbrk (0); + brkfound++; + } + return (char *)sbrk (0) - (char *)lbreak; + } + #endif + /* Return a pointer to free()able block of memory large enough to hold BYTES number of bytes. If the memory cannot be allocated, *************** *** 74,84 **** if (temp == 0) { ! if (brkfound == 0) ! { ! lbreak = (PTR_T)sbrk (0); ! brkfound++; ! } ! allocated = (char *)sbrk (0) - (char *)lbreak; fatal_error ("xmalloc: cannot allocate %lu bytes (%lu bytes allocated)", (unsigned long)bytes, (unsigned long)allocated); } --- 87,96 ---- if (temp == 0) { ! #if defined (HAVE_SBRK) ! allocated = findbrk (); fatal_error ("xmalloc: cannot allocate %lu bytes (%lu bytes allocated)", (unsigned long)bytes, (unsigned long)allocated); + #else + fatal_error ("xmalloc: cannot allocate %lu bytes", (unsigned long)bytes); + #endif /* !HAVE_SBRK */ } *************** *** 97,107 **** if (temp == 0) { ! if (brkfound == 0) ! { ! lbreak = (PTR_T)sbrk (0); ! brkfound++; ! } ! allocated = (char *)sbrk (0) - (char *)lbreak; fatal_error ("xrealloc: cannot reallocate %lu bytes (%lu bytes allocated)", (unsigned long)bytes, (unsigned long)allocated); } --- 109,118 ---- if (temp == 0) { ! #if defined (HAVE_SBRK) ! allocated = findbrk (); fatal_error ("xrealloc: cannot reallocate %lu bytes (%lu bytes allocated)", (unsigned long)bytes, (unsigned long)allocated); + #else + fatal_error ("xmalloc: cannot allocate %lu bytes", (unsigned long)bytes); + #endif /* !HAVE_SBRK */ } diff -aNrc2 bash-2.02.1/y.tab.c bash-2.03/y.tab.c *** bash-2.02.1/y.tab.c Wed Mar 25 12:16:44 1998 --- bash-2.03/y.tab.c Thu Feb 18 10:36:04 1999 *************** *** 2000,2008 **** /* Shell meta-characters that, when unquoted, separate words. */ ! #define shellmeta(c) (strchr ("()<>;&|", (c)) != 0) ! #define shellbreak(c) (strchr ("()<>;&| \t\n", (c)) != 0) #define shellquote(c) ((c) == '"' || (c) == '`' || (c) == '\'') #define shellexp(c) ((c) == '$' || (c) == '<' || (c) == '>') /* The token currently being read. */ static int current_token; --- 2000,2011 ---- /* Shell meta-characters that, when unquoted, separate words. */ ! #define shellmeta(c) (strchr (shell_meta_chars, (c)) != 0) ! #define shellbreak(c) (strchr (shell_break_chars, (c)) != 0) #define shellquote(c) ((c) == '"' || (c) == '`' || (c) == '\'') #define shellexp(c) ((c) == '$' || (c) == '<' || (c) == '>') + char *shell_meta_chars = "()<>;&|"; + char *shell_break_chars = "()<>;&| \t\n"; + /* The token currently being read. */ static int current_token; *************** *** 2681,2684 **** --- 2684,2691 ---- }; + /* XXX - we should also have an alist with strings for other tokens, so we + can give more descriptive error messages. Look at y.tab.h for the + other tokens. */ + /* These are used by read_token_word, but appear up here so that shell_getc can use them to decide when to add otherwise blank lines to the history. */ *************** *** 3133,3136 **** --- 3140,3148 ---- case OR_OR: case '&': + case DO: + case THEN: + case ELSE: + case '{': + case '(': return 1; default: *************** *** 3236,3240 **** #if defined (COMMAND_TIMING) ! if (STREQ (token, "time") && time_command_acceptable ()) return (TIME); #endif /* COMMAND_TIMING */ --- 3248,3252 ---- #if defined (COMMAND_TIMING) ! if (STREQ (token, "time") && ((parser_state & PST_CASEPAT) == 0) && time_command_acceptable ()) return (TIME); #endif /* COMMAND_TIMING */ *************** *** 3502,3505 **** --- 3514,3520 ---- reprompting the user, if necessary, after reading a newline, and returning correct error values if it reads EOF. */ + + #define P_FIRSTCLOSE 0x01 + static char matched_pair_error; static char * *************** *** 3561,3565 **** else if (ch == close) /* ending delimiter */ count--; ! else if (ch == open) /* nested begin */ count++; --- 3576,3580 ---- else if (ch == close) /* ending delimiter */ count--; ! else if (((flags & P_FIRSTCLOSE) == 0) && ch == open) /* nested begin */ count++; *************** *** 3623,3627 **** nestret = parse_matched_pair (0, '(', ')', &nestlen, 0); else if (ch == '{') /* } */ ! nestret = parse_matched_pair (0, '{', '}', &nestlen, 0); else if (ch == '[') /* ] */ nestret = parse_matched_pair (0, '[', ']', &nestlen, 0); --- 3638,3642 ---- nestret = parse_matched_pair (0, '(', ')', &nestlen, 0); else if (ch == '{') /* } */ ! nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE); else if (ch == '[') /* ] */ nestret = parse_matched_pair (0, '[', ']', &nestlen, 0); *************** *** 4001,4005 **** { if (peek_char == '{') /* } */ ! ttok = parse_matched_pair (cd, '{', '}', &ttoklen, 0); else if (peek_char == '(') /* ) */ { --- 4016,4020 ---- { if (peek_char == '{') /* } */ ! ttok = parse_matched_pair (cd, '{', '}', &ttoklen, P_FIRSTCLOSE); else if (peek_char == '(') /* ) */ { *************** *** 4055,4058 **** --- 4070,4090 ---- goto next_character; } + /* This could eventually be extended to recognize all of the + shell's single-character parameter expansions, and set flags.*/ + else if (character == '$' && peek_char == '$') + { + ttok = xmalloc (3); + ttok[0] = ttok[1] = '$'; + ttok[2] = '\0'; + RESIZE_MALLOCED_BUFFER (token, token_index, 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + strcpy (token + token_index, ttok); + token_index += 2; + dollar_present = 1; + all_digits = 0; + FREE (ttok); + goto next_character; + } else shell_ungetc (peek_char); *************** *** 4069,4072 **** --- 4101,4109 ---- if (ttok == &matched_pair_error) return -1; /* Bail immediately. */ + if (ttok[0] == '(') /* ) */ + { + FREE (ttok); + return -1; + } RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, token_buffer_size, *************** *** 4687,4693 **** case '$': ! temp = xmalloc (2); ! temp[0] = current_user.euid == 0 ? '#' : '$'; ! temp[1] = '\0'; goto add_string; --- 4724,4732 ---- case '$': ! t = temp = xmalloc (3); ! if ((promptvars || posixly_correct) && (current_user.euid != 0)) ! *t++ = '\\'; ! *t++ = current_user.euid == 0 ? '#' : '$'; ! *t = '\0'; goto add_string;