From: Chet Ramey Date: Sun, 4 Dec 2011 03:46:14 +0000 (-0500) Subject: commit bash-20060307 snapshot X-Git-Tag: bash-3.2-alpha~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74d9692be073ebf7c2781eee7c8e556b544603ea;p=thirdparty%2Fbash.git commit bash-20060307 snapshot --- diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 7e2b42200..a2ba866eb 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -13150,3 +13150,44 @@ parse.y ${...} constructs inside `` - in parse_matched_pair, remove special code that recursively parses quoted strings inside `` constructs. For Bourne shell compatibility + + 3/6 + --- +builtins/pushd.def + - let get_directory_stack take take an `int flags' argument and convert + $HOME to ~ if flags&1 is non-zero + +builtins/common.h + - change extern declaration for get_directory_stack + +variables.c + - call get_directory_stack with an arg of 0 to inhibit converting + $HOME to ~ in the result. Fixes cd ${DIRSTACK[1]} problem + reported by Len Lattanzi (cd fails because + the tildes won't be expanded after variable expansion) + +jobs.c + - changed hangup_all_jobs slightly so stopped jobs marked J_NOHUP + won't get a SIGCONT + +general.c + - changed check_binary_file() to check for a NUL byte instead of a + non-printable character. Might at some point want to check + entire (possibly multibyte) characters instead of just bytes. Hint + from ksh via David Korn + + 3/7 + --- +builtins/reserved.def + - changed runs of spaces to tabs in variables help text to make + indentation better when displayed + +builtins/mkbuiltins.c + - changes to avoid the annoying extra space that keeps gettext from + being passed an empty string + + 3/9 + --- +lib/glob/glob.c + - make sure globbing is interrupted if the shell receives a terminating + signal diff --git a/CWRU/CWRU.chlog~ b/CWRU/CWRU.chlog~ index 68a4e8f69..cd1ee9716 100644 --- a/CWRU/CWRU.chlog~ +++ b/CWRU/CWRU.chlog~ @@ -13140,14 +13140,48 @@ lib/glob/glob.c 3/5 --- trap.c - - change `||' to `&&' and make the DEBUG, ERR, and RETURN traps - inherited when the appropriate shell options are set, not just when - the shell is in debugging mode and the appropriate options are set. - This matches the documentation. - Reported by Philip Susi + - inheritance of the DEBUG, RETURN, and ERR traps is now dependent + only on the `functrace' and `errtrace' shell options, as the + documentation says, rather than on whether or not the shell is in + debugging mode. Reported by Philip Susi parse.y - in parse_matched_pair, don't recursively parse ${...} or other ${...} constructs inside `` - in parse_matched_pair, remove special code that recursively parses quoted strings inside `` constructs. For Bourne shell compatibility + + 3/6 + --- +builtins/pushd.def + - let get_directory_stack take take an `int flags' argument and convert + $HOME to ~ if flags&1 is non-zero + +builtins/common.h + - change extern declaration for get_directory_stack + +variables.c + - call get_directory_stack with an arg of 0 to inhibit converting + $HOME to ~ in the result. Fixes cd ${DIRSTACK[1]} problem + reported by Len Lattanzi (cd fails because + the tildes won't be expanded after variable expansion) + +jobs.c + - changed hangup_all_jobs slightly so stopped jobs marked J_NOHUP + won't get a SIGCONT + +general.c + - changed check_binary_file() to check for a NUL byte instead of a + non-printable character. Might at some point want to check + entire (possibly multibyte) characters instead of just bytes. Hint + from ksh via David Korn + + 3/7 + --- +builtins/reserved.def + - changed runs of spaces to tabs in variables help text to make + indentation better when displayed + +builtins/mkbuiltins.c + - changes to avoid the annoying extra space that keeps gettext from + being passed an empty string diff --git a/NOTES b/NOTES index d6e3d813b..c523752fe 100644 --- a/NOTES +++ b/NOTES @@ -327,3 +327,7 @@ Platform-Specific Configuration and Operation Notes 16. Configure --disable-multibyte on NetBSD versions (1.4 through at least 1.6.1) that include wctype.h but do not define wctype_t. + +17. Do NOT use bison-1.75. It builds a non-working parser. The most + obvious effect is that constructs like "for i; do echo $i; done" don't + loop over the positional parameters. diff --git a/builtins/Makefile.in b/builtins/Makefile.in index 486ec6543..e027f7aaa 100644 --- a/builtins/Makefile.in +++ b/builtins/Makefile.in @@ -16,7 +16,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. -PACKAGE = @PACKAGE@ +PACKAGE = @PACKAGE_NAME@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ diff --git a/builtins/common.h b/builtins/common.h index df3032529..1233d667a 100644 --- a/builtins/common.h +++ b/builtins/common.h @@ -149,7 +149,7 @@ extern void set_var_attribute __P((char *, int, int)); extern char *get_dirstack_from_string __P((char *)); extern char *get_dirstack_element __P((intmax_t, int)); extern void set_dirstack_element __P((intmax_t, int, char *)); -extern WORD_LIST *get_directory_stack __P((void)); +extern WORD_LIST *get_directory_stack __P((int)); /* Functions from evalstring.c */ extern int parse_and_execute __P((char *, const char *, int)); diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c index 1e7665bcf..ff0bdc090 100644 --- a/builtins/mkbuiltins.c +++ b/builtins/mkbuiltins.c @@ -1369,7 +1369,7 @@ write_documentation (stream, documentation, indentation, flags) register char *line; int string_array, texinfo, base_indent, last_cpp, filename_p; - if (!stream) + if (stream == 0) return; string_array = flags & STRING_ARRAY; @@ -1381,7 +1381,12 @@ write_documentation (stream, documentation, indentation, flags) if (single_longdoc_strings) { if (filename_p == 0) - fprintf (stream, "N_(\" "); /* the empty string translates specially. */ + { + if (documentation && documentation[0] && documentation[0][0]) + fprintf (stream, "N_(\""); + else + fprintf (stream, "N_(\" "); /* the empty string translates specially. */ + } else fprintf (stream, "\""); } @@ -1407,7 +1412,12 @@ write_documentation (stream, documentation, indentation, flags) if (string_array && single_longdoc_strings == 0) { if (filename_p == 0) - fprintf (stream, " N_(\" "); /* the empty string translates specially. */ + { + if (line[0]) + fprintf (stream, " N_(\""); + else + fprintf (stream, " N_(\" "); /* the empty string translates specially. */ + } else fprintf (stream, " \""); } diff --git a/builtins/pushd.def b/builtins/pushd.def index 19a3ed466..86c0bddb5 100644 --- a/builtins/pushd.def +++ b/builtins/pushd.def @@ -620,7 +620,8 @@ set_dirstack_element (ind, sign, value) } WORD_LIST * -get_directory_stack () +get_directory_stack (flags) + int flags; { register int i; WORD_LIST *ret; @@ -628,7 +629,8 @@ get_directory_stack () for (ret = (WORD_LIST *)NULL, i = 0; i < directory_list_offset; i++) { - d = polite_directory_format (pushd_directory_list[i]); + d = (flags&1) ? polite_directory_format (pushd_directory_list[i]) + : pushd_directory_list[i]; ret = make_word_list (make_word (d), ret); } /* Now the current directory. */ diff --git a/builtins/reserved.def b/builtins/reserved.def index 5482f5f36..e968ec7cf 100644 --- a/builtins/reserved.def +++ b/builtins/reserved.def @@ -2,7 +2,7 @@ This file is reserved.def, in which the shell reserved words are defined. It has no direct C file production, but defines builtins for the Bash builtin help command. -Copyright (C) 1987-2005 Free Software Foundation, Inc. +Copyright (C) 1987-2006 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. @@ -146,21 +146,21 @@ $END $BUILTIN variables $DOCNAME variable_help $SHORT_DOC variables - Some variable names and meanings -BASH_VERSION Version information for this Bash. -CDPATH A colon-separated list of directories to search +BASH_VERSION Version information for this Bash. +CDPATH A colon-separated list of directories to search for directries given as arguments to `cd'. GLOBIGNORE A colon-separated list of patterns describing filenames to be ignored by pathname expansion. #if defined (HISTORY) -HISTFILE The name of the file where your command history is stored. -HISTFILESIZE The maximum number of lines this file can contain. -HISTSIZE The maximum number of history lines that a running +HISTFILE The name of the file where your command history is stored. +HISTFILESIZE The maximum number of lines this file can contain. +HISTSIZE The maximum number of history lines that a running shell can access. #endif /* HISTORY */ -HOME The complete pathname to your login directory. +HOME The complete pathname to your login directory. HOSTNAME The name of the current host. -HOSTTYPE The type of CPU this version of Bash is running under. -IGNOREEOF Controls the action of the shell on receipt of an EOF +HOSTTYPE The type of CPU this version of Bash is running under. +IGNOREEOF Controls the action of the shell on receipt of an EOF character as the sole input. If set, then the value of it is the number of EOF characters that can be seen in a row on an empty line before the shell will exit @@ -169,19 +169,19 @@ MACHTYPE A string describing the current system Bash is running on. MAILCHECK How often, in seconds, Bash checks for new mail. MAILPATH A colon-separated list of filenames which Bash checks for new mail. -OSTYPE The version of Unix this version of Bash is running on. -PATH A colon-separated list of directories to search when +OSTYPE The version of Unix this version of Bash is running on. +PATH A colon-separated list of directories to search when looking for commands. -PROMPT_COMMAND A command to be executed before the printing of each +PROMPT_COMMAND A command to be executed before the printing of each primary prompt. -PS1 The primary prompt string. -PS2 The secondary prompt string. +PS1 The primary prompt string. +PS2 The secondary prompt string. PWD The full pathname of the current directory. SHELLOPTS A colon-separated list of enabled shell options. -TERM The name of the current terminal type. +TERM The name of the current terminal type. TIMEFORMAT The output format for timing statistics displayed by the `time' reserved word. -auto_resume Non-null means a command word appearing on a line by +auto_resume Non-null means a command word appearing on a line by itself is first looked for in the list of currently stopped jobs. If found there, that job is foregrounded. A value of `exact' means that the command word must @@ -191,7 +191,7 @@ auto_resume Non-null means a command word appearing on a line by the command must be a prefix of a stopped job. #if defined (HISTORY) # if defined (BANG_HISTORY) -histchars Characters controlling history expansion and quick +histchars Characters controlling history expansion and quick substitution. The first character is the history substitution character, usually `!'. The second is the `quick substitution' character, usually `^'. The diff --git a/general.c b/general.c index 20160fe96..20dbd4443 100644 --- a/general.c +++ b/general.c @@ -477,8 +477,13 @@ check_binary_file (sample, sample_len) if (c == '\n') return (0); +#if 0 if (ISSPACE (c) == 0 && ISPRINT (c) == 0) +#else + if (c == '\0') +#endif return (1); + } return (0); diff --git a/jobs.c b/jobs.c index 0e43e9746..37cb85f4f 100644 --- a/jobs.c +++ b/jobs.c @@ -1230,8 +1230,9 @@ hangup_all_jobs () { if (jobs[i]) { - if ((jobs[i]->flags & J_NOHUP) == 0) - killpg (jobs[i]->pgrp, SIGHUP); + if (jobs[i]->flags & J_NOHUP) + continue; + killpg (jobs[i]->pgrp, SIGHUP); if (STOPPED (i)) killpg (jobs[i]->pgrp, SIGCONT); } diff --git a/lib/glob/glob.c b/lib/glob/glob.c index 5395bcbb2..5c564f660 100644 --- a/lib/glob/glob.c +++ b/lib/glob/glob.c @@ -470,7 +470,7 @@ glob_vector (pat, dir, flags) while (1) { /* Make globbing interruptible in the shell. */ - if (interrupt_state) + if (interrupt_state || terminating_signal) { lose = 1; break; diff --git a/lib/glob/glob.c~ b/lib/glob/glob.c~ index f048f99ab..5395bcbb2 100644 --- a/lib/glob/glob.c~ +++ b/lib/glob/glob.c~ @@ -508,10 +508,7 @@ glob_vector (pat, dir, flags) { nextlink = (struct globval *) malloc (sizeof (struct globval)); if (firstmalloc == 0) -{ firstmalloc = nextlink; -itrace("glob_vector: switching from alloca to malloc for nextlink: count = %d", count); -} } nextname = (char *) malloc (D_NAMLEN (dp) + 1); if (nextlink == 0 || nextname == 0) 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 diff --git a/variables.c b/variables.c index e8018f823..f9b9de79e 100644 --- a/variables.c +++ b/variables.c @@ -1359,7 +1359,7 @@ get_dirstack (self) ARRAY *a; WORD_LIST *l; - l = get_directory_stack (); + l = get_directory_stack (0); a = array_from_word_list (l); array_dispose (array_cell (self)); dispose_words (l);