diff options
author | Sebastian Schmidt <yath@yath.de> | 2012-04-17 11:23:35 +0200 |
---|---|---|
committer | Sebastian Schmidt <yath@yath.de> | 2012-04-17 11:24:20 +0200 |
commit | f4b417c62a4f272c4cf9a074d0f7a3a97201f9db (patch) | |
tree | e2196f3b6361e2377c43ab47a3abf17d8f6afd77 /builtins/read.def | |
parent | 791237e44695d2ee123c8a6f665ef074f5fadfbb (diff) | |
download | external_bash-f4b417c62a4f272c4cf9a074d0f7a3a97201f9db.zip external_bash-f4b417c62a4f272c4cf9a074d0f7a3a97201f9db.tar.gz external_bash-f4b417c62a4f272c4cf9a074d0f7a3a97201f9db.tar.bz2 |
Update to upstream bash 4.2
This upgrades bash to from 4.1-rc to 4.2-release. See CWRU/changelog for
changes.
Change-Id: I926269c300cf44fa25964b5b375a148fcf11c4b7
Diffstat (limited to 'builtins/read.def')
-rw-r--r-- | builtins/read.def | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/builtins/read.def b/builtins/read.def index 20860be..c4a668a 100644 --- a/builtins/read.def +++ b/builtins/read.def @@ -1,7 +1,7 @@ This file is read.def, from which is created read.c. It implements the builtin "read" in Bash. -Copyright (C) 1987-2009 Free Software Foundation, Inc. +Copyright (C) 1987-2010 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. @@ -793,11 +793,16 @@ assign_vars: } else var = bind_read_variable (list->word->word, input_string); - stupidly_hack_special_variables (list->word->word); - FREE (tofree); if (var) - VUNSETATTR (var, att_invisible); + { + stupidly_hack_special_variables (list->word->word); + VUNSETATTR (var, att_invisible); + } + else + retval = EXECUTION_FAILURE; + + FREE (tofree); xfree (orig_input_string); return (retval); @@ -807,14 +812,17 @@ static SHELL_VAR * bind_read_variable (name, value) char *name, *value; { + SHELL_VAR *v; #if defined (ARRAY_VARS) if (valid_array_reference (name) == 0) - return (bind_variable (name, value, 0)); + v = bind_variable (name, value, 0); else - return (assign_array_element (name, value, 0)); + v = assign_array_element (name, value, 0); #else /* !ARRAY_VARS */ - return bind_variable (name, value, 0); + v = bind_variable (name, value, 0); #endif /* !ARRAY_VARS */ + return (v == 0 ? v + : ((readonly_p (v) || noassign_p (v)) ? (SHELL_VAR *)NULL : v)); } #if defined (HANDLE_MULTIBYTE) |