From: Chet Ramey Date: Mon, 9 Jan 2012 13:28:12 +0000 (-0500) Subject: commit bash-20110916 snapshot X-Git-Tag: bash-4.3-alpha~105 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b13b8a87dd864cd836cd9720088c8d04b3140a60;p=thirdparty%2Fbash.git commit bash-20110916 snapshot --- diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index e627c32e0..5e0b3a9cc 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -12179,3 +12179,11 @@ bashline.c - bash_filename_stat_hook: new function, designed to expand variable references in filenames before readline passes them to stat(2) to determine whether or not they are a directory + + 9/15 + ---- +builtins/declare.def + - if assign_array_element fails due to a bad (or empty) subscript, mark + it as an assignment error and don't attempt any further processing + of that declaration. Fixes segfault bug reported by Diego Augusto + Molina diff --git a/builtins/declare.def b/builtins/declare.def index 55206fa79..8b9b850cc 100644 --- a/builtins/declare.def +++ b/builtins/declare.def @@ -513,6 +513,11 @@ declare_internal (list, local_var) *subscript_start = '['; /* ] */ var = assign_array_element (name, value, 0); /* XXX - not aflags */ *subscript_start = '\0'; + if (var == 0) /* some kind of assignment error */ + { + assign_error++; + NEXT_VARIABLE (); + } } else if (simple_array_assign) { diff --git a/builtins/read.def b/builtins/read.def index 9e9da523a..41757c0c8 100644 --- a/builtins/read.def +++ b/builtins/read.def @@ -53,8 +53,9 @@ Options: -t timeout time out and return failure if a complete line of input is not read withint TIMEOUT seconds. The value of the TMOUT variable is the default timeout. TIMEOUT may be a - fractional number. If TIMEOUT is 0, read returns success only - if input is available on the specified file descriptor. The + fractional number. If TIMEOUT is 0, read returns immediately, + without trying to read any data, returning success only if + input is available on the specified file descriptor. The exit status is greater than 128 if the timeout is exceeded -u fd read from file descriptor FD instead of the standard input diff --git a/doc/bash.1 b/doc/bash.1 index 57f5a5ac6..4be04a6c7 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -5,12 +5,12 @@ .\" Case Western Reserve University .\" chet@po.cwru.edu .\" -.\" Last Change: Thu Sep 8 09:39:24 EDT 2011 +.\" Last Change: Fri Sep 16 08:43:45 EDT 2011 .\" .\" bash_builtins, strip all but Built-Ins section .if \n(zZ=1 .ig zZ .if \n(zY=1 .ig zY -.TH BASH 1 "2011 September 8" "GNU Bash 4.2" +.TH BASH 1 "2011 September 16" "GNU Bash 4.2" .\" .\" There's some problem with having a `@' .\" in a tagged paragraph with the BSD man macros. @@ -8394,8 +8394,9 @@ the decimal point. This option is only effective if \fBread\fP is reading input from a terminal, pipe, or other special file; it has no effect when reading from regular files. -If \fItimeout\fP is 0, \fBread\fP returns success if input is available on -the specified file descriptor, failure otherwise. +If \fItimeout\fP is 0, \fBread\fP returns immediately, without trying to +read any data. The exit statis is 0 if input is available on +the specified file descriptor, non-zero otherwise. The exit status is greater than 128 if the timeout is exceeded. .TP .B \-u \fIfd\fP diff --git a/doc/bashref.texi b/doc/bashref.texi index 814623bf5..79fd38ffa 100644 --- a/doc/bashref.texi +++ b/doc/bashref.texi @@ -3970,8 +3970,9 @@ the decimal point. This option is only effective if @code{read} is reading input from a terminal, pipe, or other special file; it has no effect when reading from regular files. -If @var{timeout} is 0, @code{read} returns success if input is available on -the specified file descriptor, failure otherwise. +If @var{timeout} is 0, @code{read} returns immediately, without trying to +read and data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. The exit status is greater than 128 if the timeout is exceeded. @item -u @var{fd} diff --git a/doc/version.texi b/doc/version.texi index 55c1c660c..15784c9a9 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -2,9 +2,9 @@ Copyright (C) 1988-2011 Free Software Foundation, Inc. @end ignore -@set LASTCHANGE Thu Sep 8 09:39:10 EDT 2011 +@set LASTCHANGE Fri Sep 16 08:44:02 EDT 2011 @set EDITION 4.2 @set VERSION 4.2 -@set UPDATED 8 September 2011 +@set UPDATED 16 September 2011 @set UPDATED-MONTH September 2011