From be7d8f2da47b594d946bf95a3ab9cb9b0445eee2 Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Sat, 3 Dec 2011 13:35:38 -0500 Subject: [PATCH] commit bash-20040826 snapshot --- CWRU/CWRU.chlog | 14 ++++ CWRU/CWRU.chlog~ | 30 ++++++++ autom4te.cache/requests | 152 ++++++++++++++++++++-------------------- builtins/hash.def | 9 ++- doc/bash.1 | 18 ++++- doc/bash.1~ | 7 +- doc/bashref.texi | 17 ++++- doc/bashref.texi~ | 13 ++-- doc/version.texi | 4 +- tests/RUN-ONE-TEST | 2 +- 10 files changed, 172 insertions(+), 94 deletions(-) diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 4d1742090..faf32a430 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -9934,3 +9934,17 @@ configure.in sys/stream.h). The correct checks are in the code, but autoconf complains if sys/stream.h is not included, rather than simply checking for the header's presence + + 8/26 + ---- +builtins/hash.def + - fix a bug that prevented `hash -d' from working right (as soon as + hash removed a command from the table, the bug caused it to be added + right back) + + 8/27 + ---- +doc/{bash.1,bashref.texi} + - explicitly note that conditional primaries that operate on files + operate on the targets of symbolic links rather than the links + themselves diff --git a/CWRU/CWRU.chlog~ b/CWRU/CWRU.chlog~ index 218ffdc68..3d12e060f 100644 --- a/CWRU/CWRU.chlog~ +++ b/CWRU/CWRU.chlog~ @@ -9917,3 +9917,33 @@ lib/readline/mbutil.c - make sure _rl_find_next_mbchar_internal has a valid multibyte character before it checks whether or not it's a zero-width wide character and adjusts point accordingly + + 8/24 + ---- +bashline.c + - new function, bash_directory_expansion, duplicates the expansions + performed on the directory name by rl_filename_completion_function + - call bash_directory_expansion in command_word_completion_function + if we decide we're doing tilde expansion (and any other + canonicalization) on the directory name being completed + + 8/25 + ---- +configure.in + - use new-style AC_CHECK_HEADER to check for sys/ptem.h (which requires + sys/stream.h). The correct checks are in the code, but autoconf + complains if sys/stream.h is not included, rather than simply + checking for the header's presence + + 8/26 + ---- +builtins/hash.def + - fix a bug that prevented `hash -d' from working right (as soon as + hash removed a command from the table, the bug caused it to be added + right back) + + 8/27 + ---- +doc/{bash.1,bashref.texi} + - explicitly note that condition primaries that operate on files operate + on the targets of symbolic links rather than the links themselves diff --git a/autom4te.cache/requests b/autom4te.cache/requests index a474a1cef..90908ed31 100644 --- a/autom4te.cache/requests +++ b/autom4te.cache/requests @@ -15,96 +15,96 @@ 'configure.in' ], { - 'AC_TYPE_UID_T' => 1, - 'AC_DEFINE_TRACE_LITERAL' => 1, - 'AC_C_CONST' => 1, - 'AC_PROG_RANLIB' => 1, - 'AC_FUNC_CHOWN' => 1, - 'AC_FUNC_MBRTOWC' => 1, + 'AH_OUTPUT' => 1, + 'AC_FUNC_UTIME_NULL' => 1, + 'AC_TYPE_OFF_T' => 1, + 'AC_FUNC_SELECT_ARGTYPES' => 1, + 'AC_PROG_AWK' => 1, + 'AM_AUTOMAKE_VERSION' => 1, 'AC_CANONICAL_HOST' => 1, - 'm4_pattern_forbid' => 1, - 'AC_HEADER_SYS_WAIT' => 1, - 'AM_MAINTAINER_MODE' => 1, + 'AC_CHECK_LIB' => 1, + 'AC_CHECK_TYPES' => 1, + 'AC_FUNC_STRFTIME' => 1, 'AC_FUNC_SETPGRP' => 1, - 'AC_REPLACE_FNMATCH' => 1, - 'AC_FUNC_STAT' => 1, - 'AC_FUNC_STRERROR_R' => 1, - 'AC_HEADER_STDC' => 1, - 'AC_FUNC_WAIT3' => 1, - 'AC_FUNC_CLOSEDIR_VOID' => 1, - 'AM_GNU_GETTEXT' => 1, - 'AC_FUNC_OBSTACK' => 1, - 'AC_FUNC_REALLOC' => 1, + 'AC_SUBST' => 1, + 'AC_FUNC_STRTOD' => 1, 'AM_PROG_CC_C_O' => 1, + 'AC_PROG_INSTALL' => 1, + 'AC_PROG_MAKE_SET' => 1, + 'AM_INIT_AUTOMAKE' => 1, 'AC_CONFIG_FILES' => 1, - 'AC_FUNC_MKTIME' => 1, - 'm4_pattern_allow' => 1, - 'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1, - 'AC_INIT' => 1, - 'AC_FUNC_VPRINTF' => 1, - 'AC_PROG_LIBTOOL' => 1, - 'AC_STRUCT_ST_BLOCKS' => 1, + 'AC_TYPE_MODE_T' => 1, + 'AC_TYPE_PID_T' => 1, + 'AC_FUNC_OBSTACK' => 1, + 'AC_FUNC_GETPGRP' => 1, + 'AC_PROG_GCC_TRADITIONAL' => 1, + 'AC_HEADER_STDC' => 1, + 'AC_FUNC_ALLOCA' => 1, + 'AM_GNU_GETTEXT' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AC_CHECK_FUNCS' => 1, + 'AC_TYPE_SIGNAL' => 1, + 'AC_FUNC_STRNLEN' => 1, + 'AC_HEADER_DIRENT' => 1, + 'AC_STRUCT_TM' => 1, + 'AC_CHECK_MEMBERS' => 1, + 'AC_FUNC_STRCOLL' => 1, + 'AM_CONDITIONAL' => 1, + 'AC_FUNC_MEMCMP' => 1, 'AC_PATH_X' => 1, + 'include' => 1, 'AC_LIBSOURCE' => 1, - 'AC_FUNC_MALLOC' => 1, - 'AC_FUNC_STRNLEN' => 1, - 'AC_FUNC_ERROR_AT_LINE' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'AC_FUNC_VPRINTF' => 1, + 'AC_FUNC_MBRTOWC' => 1, + 'AC_FUNC_SETVBUF_REVERSED' => 1, + 'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1, + 'AC_FUNC_STAT' => 1, + 'AC_FUNC_WAIT3' => 1, 'AC_CANONICAL_SYSTEM' => 1, - 'AC_HEADER_DIRENT' => 1, - 'AC_CONFIG_AUX_DIR' => 1, - 'AC_CONFIG_HEADERS' => 1, - 'AC_STRUCT_TIMEZONE' => 1, - 'AC_PROG_CC' => 1, - 'AC_FUNC_GETGROUPS' => 1, - 'AC_FUNC_FORK' => 1, - 'AC_TYPE_PID_T' => 1, - 'AC_PROG_MAKE_SET' => 1, 'AC_HEADER_TIME' => 1, - 'AC_FUNC_UTIME_NULL' => 1, - 'AC_FUNC_MEMCMP' => 1, - 'AC_HEADER_MAJOR' => 1, + 'AC_PROG_YACC' => 1, + 'AC_FUNC_REALLOC' => 1, + 'AC_CHECK_HEADERS' => 1, + 'AC_PROG_CXX' => 1, + 'AC_REPLACE_FNMATCH' => 1, + 'm4_pattern_allow' => 1, + 'AC_TYPE_SIZE_T' => 1, + 'AC_FUNC_MKTIME' => 1, + 'AC_PROG_LEX' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + 'AC_PROG_CC' => 1, + 'AC_INIT' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AC_FUNC_ERROR_AT_LINE' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, 'AC_PROG_CPP' => 1, - 'AC_FUNC_SETVBUF_REVERSED' => 1, - 'include' => 1, - 'AC_FUNC_FSEEKO' => 1, - 'AC_HEADER_STAT' => 1, - 'AC_C_INLINE' => 1, - 'AC_FUNC_GETMNTENT' => 1, - 'AM_CONDITIONAL' => 1, - 'AC_STRUCT_TM' => 1, + 'AC_TYPE_UID_T' => 1, + 'AC_HEADER_MAJOR' => 1, + 'm4_pattern_forbid' => 1, 'AC_FUNC_LSTAT' => 1, + 'AC_C_CONST' => 1, + 'AC_FUNC_CHOWN' => 1, + 'AC_STRUCT_ST_BLOCKS' => 1, + 'AC_FUNC_STRERROR_R' => 1, + 'AC_FUNC_FORK' => 1, + 'AC_FUNC_MMAP' => 1, 'AC_DECL_SYS_SIGLIST' => 1, - 'AC_SUBST' => 1, - 'AC_FUNC_ALLOCA' => 1, - 'AC_FUNC_STRFTIME' => 1, + 'AC_FUNC_GETMNTENT' => 1, + 'AC_FUNC_FSEEKO' => 1, + 'AC_FUNC_MALLOC' => 1, 'AC_FUNC_GETLOADAVG' => 1, - 'AC_PROG_YACC' => 1, - 'AC_TYPE_SIGNAL' => 1, - 'AC_FUNC_MMAP' => 1, - 'AC_PROG_INSTALL' => 1, - 'AH_OUTPUT' => 1, - 'AC_FUNC_SELECT_ARGTYPES' => 1, - 'AC_FUNC_STRTOD' => 1, - 'AC_PROG_GCC_TRADITIONAL' => 1, - 'AC_FUNC_GETPGRP' => 1, - 'AC_CHECK_TYPES' => 1, - 'AM_INIT_AUTOMAKE' => 1, - 'AC_FUNC_STRCOLL' => 1, - 'AC_CHECK_FUNCS' => 1, - 'AC_PROG_AWK' => 1, - 'AC_CHECK_MEMBERS' => 1, - 'AC_PROG_LEX' => 1, - 'AC_C_VOLATILE' => 1, - 'AC_TYPE_MODE_T' => 1, - 'AC_TYPE_OFF_T' => 1, - 'AC_CONFIG_SUBDIRS' => 1, 'AC_PROG_LN_S' => 1, - 'AC_TYPE_SIZE_T' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - 'AC_PROG_CXX' => 1, - 'AC_CHECK_HEADERS' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + 'AC_C_VOLATILE' => 1, + 'AC_PROG_RANLIB' => 1, + 'AC_C_INLINE' => 1, + 'AC_FUNC_CLOSEDIR_VOID' => 1, + 'AC_HEADER_SYS_WAIT' => 1, 'm4_include' => 1, - 'AC_CHECK_LIB' => 1 + 'AC_HEADER_STAT' => 1, + 'AC_FUNC_GETGROUPS' => 1, + 'AC_STRUCT_TIMEZONE' => 1 } ], 'Request' ) ); diff --git a/builtins/hash.def b/builtins/hash.def index 9425c0370..b29595219 100644 --- a/builtins/hash.def +++ b/builtins/hash.def @@ -165,10 +165,13 @@ hash_builtin (list) } else if (absolute_program (w)) continue; - else if (delete && phash_remove (w)) + else if (delete) { - sh_notfound (w); - opt = EXECUTION_FAILURE; + if (phash_remove (w)) + { + sh_notfound (w); + opt = EXECUTION_FAILURE; + } } else if (add_hashed_command (w, 0)) opt = EXECUTION_FAILURE; diff --git a/doc/bash.1 b/doc/bash.1 index 80ee5ae0b..91277b6cf 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -6,7 +6,7 @@ .\" Case Western Reserve University .\" chet@po.CWRU.Edu .\" -.\" Last Change: Mon Aug 16 23:07:25 EDT 2004 +.\" Last Change: Fri Aug 27 12:14:46 EDT 2004 .\" .\" bash_builtins, strip all but Built-Ins section .if \n(zZ=1 .ig zZ @@ -1130,6 +1130,10 @@ Expands to the positional parameters, starting from one. When the expansion occurs within double quotes, each parameter expands to a separate word. That is, "\fB$@\fP" is equivalent to "\fB$1\fP" "\fB$2\fP" ... +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. When there are no positional parameters, "\fB$@\fP" and .B $@ expand to nothing (i.e., they are removed). @@ -1222,7 +1226,7 @@ The command argument to the \fB\-c\fP invocation option. .TP .B BASH_LINENO An array variable whose members are the line numbers in source files -corresponding to each member of @var{FUNCNAME}. +corresponding to each member of \fBFUNCNAME\fP. \fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP is the line number in the source file where \fB${FUNCNAME[\fP\fI$i + 1\fP\fB]}\fP was called. The corresponding source file name is \fB${BASH_SOURCE[\fP\fI$i + 1\fP\fB]}\fB. @@ -2035,7 +2039,12 @@ character of the .B IFS special variable, and ${\fIname\fP[@]} expands each element of \fIname\fP to a separate word. When there are no array members, -${\fIname\fP[@]} expands to nothing. This is analogous to the expansion +${\fIname\fP[@]} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the expansion of the special parameters \fB*\fP and \fB@\fP (see .B Special Parameters above). ${#\fIname\fP[\fIsubscript\fP]} expands to the length of @@ -3458,6 +3467,9 @@ If any \fIfile\fP argument to one of the primaries is of the form If the \fIfile\fP argument to one of the primaries is one of \fI/dev/stdin\fP, \fI/dev/stdout\fP, or \fI/dev/stderr\fP, file descriptor 0, 1, or 2, respectively, is checked. +.PP +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. .sp 1 .PD 0 .TP diff --git a/doc/bash.1~ b/doc/bash.1~ index 532d52d0b..584cb8cd5 100644 --- a/doc/bash.1~ +++ b/doc/bash.1~ @@ -6,7 +6,7 @@ .\" Case Western Reserve University .\" chet@po.CWRU.Edu .\" -.\" Last Change: Mon Aug 16 23:07:25 EDT 2004 +.\" Last Change: Fri Aug 27 12:14:46 EDT 2004 .\" .\" bash_builtins, strip all but Built-Ins section .if \n(zZ=1 .ig zZ @@ -3458,6 +3458,9 @@ If any \fIfile\fP argument to one of the primaries is of the form If the \fIfile\fP argument to one of the primaries is one of \fI/dev/stdin\fP, \fI/dev/stdout\fP, or \fI/dev/stderr\fP, file descriptor 0, 1, or 2, respectively, is checked. +.PP +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. .sp 1 .PD 0 .TP @@ -8232,7 +8235,7 @@ command, and before the first command executes in a shell function (see .SM .B SHELL GRAMMAR above). -Refer to the description of the \fBextglob\fP option to the +Refer to the description of the \fBextdebug\fP option to the \fBshopt\fP builtin for details of its effect on the \fBDEBUG\fP trap. If a .I sigspec diff --git a/doc/bashref.texi b/doc/bashref.texi index 2bcb4ad2e..a97a0cecd 100644 --- a/doc/bashref.texi +++ b/doc/bashref.texi @@ -1256,6 +1256,10 @@ Expands to the positional parameters, starting from one. When the expansion occurs within double quotes, each parameter expands to a separate word. That is, @code{"$@@"} is equivalent to @code{"$1" "$2" @dots{}}. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. When there are no positional parameters, @code{"$@@"} and @code{$@@} expand to nothing (i.e., they are removed). @@ -5201,6 +5205,9 @@ If the @var{file} argument to one of the primaries is one of @file{/dev/stdin}, @file{/dev/stdout}, or @file{/dev/stderr}, file descriptor 0, 1, or 2, respectively, is checked. +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. + @table @code @item -a @var{file} True if @var{file} exists. @@ -5534,12 +5541,18 @@ The braces are required to avoid conflicts with the shell's filename expansion operators. If the @var{subscript} is @samp{@@} or @samp{*}, the word expands to all members of the array @var{name}. These subscripts differ only when the word -appears within double quotes. If the word is double-quoted, +appears within double quotes. +If the word is double-quoted, @code{$@{name[*]@}} expands to a single word with the value of each array member separated by the first character of the @env{IFS} variable, and @code{$@{name[@@]@}} expands each element of @var{name} to a separate word. When there are no array members, -@code{$@{name[@@]@}} expands to nothing. This is analogous to the +@code{$@{name[@@]@}} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the expansion of the special parameters @samp{@@} and @samp{*}. @code{$@{#name[}@var{subscript}@code{]@}} expands to the length of @code{$@{name[}@var{subscript}@code{]@}}. diff --git a/doc/bashref.texi~ b/doc/bashref.texi~ index 98cf521bf..363f89ab7 100644 --- a/doc/bashref.texi~ +++ b/doc/bashref.texi~ @@ -5201,6 +5201,9 @@ If the @var{file} argument to one of the primaries is one of @file{/dev/stdin}, @file{/dev/stdout}, or @file{/dev/stderr}, file descriptor 0, 1, or 2, respectively, is checked. +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. + @table @code @item -a @var{file} True if @var{file} exists. @@ -6150,15 +6153,15 @@ Bash does not print another warning, and the stopped jobs are terminated. @item bg @btindex bg @example -bg [@var{jobspec}] +bg [@var{jobspec} @dots{}] @end example -Resume the suspended job @var{jobspec} in the background, as if it +Resume each suspended job @var{jobspec} in the background, as if it had been started with @samp{&}. If @var{jobspec} is not supplied, the current job is used. The return status is zero unless it is run when job control is not -enabled, or, when run with job control enabled, if @var{jobspec} was -not found or @var{jobspec} specifies a job that was started without -job control. +enabled, or, when run with job control enabled, if the last +@var{jobspec} was not found or the last @var{jobspec} specifies a job +that was started without job control. @item fg @btindex fg diff --git a/doc/version.texi b/doc/version.texi index 441d09137..2a6b6d7c2 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -4,7 +4,7 @@ Copyright (C) 1988-2004 Free Software Foundation, Inc. @set EDITION 3.0 @set VERSION 3.0 -@set UPDATED 16 August 2004 +@set UPDATED 27 August 2004 @set UPDATED-MONTH August 2004 -@set LASTCHANGE Mon Aug 16 23:09:57 EDT 2004 +@set LASTCHANGE Fri Aug 27 12:15:06 EDT 2004 diff --git a/tests/RUN-ONE-TEST b/tests/RUN-ONE-TEST index 72ec06a2c..3efcf32d6 100755 --- a/tests/RUN-ONE-TEST +++ b/tests/RUN-ONE-TEST @@ -1,4 +1,4 @@ -BUILD_DIR=/usr/local/build/bash/bash-current +BUILD_DIR=/usr/local/build/chet/bash/bash-current THIS_SH=$BUILD_DIR/bash PATH=$PATH:$BUILD_DIR -- 2.47.3