diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-04-09 16:13:32 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-04-09 16:15:01 -0700 |
commit | 2d698b6e42d8dca191ac795ef5dba3bf62496eec (patch) | |
tree | ac5e0b67043c50f49160e9fe407435706cf30444 /builtins/declare.def | |
parent | f1250933e4a2ac09a3d0b25b3877068e12f44da5 (diff) | |
download | vyatta-bash-2d698b6e42d8dca191ac795ef5dba3bf62496eec.tar.gz vyatta-bash-2d698b6e42d8dca191ac795ef5dba3bf62496eec.zip |
Integrate bash 3.2 version
This is merge of current Debian stable (Lenny) version of Bash
with Vyatta changes.
Diffstat (limited to 'builtins/declare.def')
-rw-r--r-- | builtins/declare.def | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/builtins/declare.def b/builtins/declare.def index d94118f..4d94fac 100644 --- a/builtins/declare.def +++ b/builtins/declare.def @@ -76,6 +76,7 @@ $END #include "bashgetopt.h" extern int array_needs_making; +extern int posixly_correct; static int declare_internal __P((register WORD_LIST *, int)); @@ -256,8 +257,12 @@ declare_internal (list, local_var) else making_array_special = 0; #endif - - if (legal_identifier (name) == 0) + + /* If we're in posix mode or not looking for a shell function (since + shell function names don't have to be valid identifiers when the + shell's not in posix mode), check whether or not the argument is a + valid, well-formed shell identifier. */ + if ((posixly_correct || (flags_on & att_function) == 0) && legal_identifier (name) == 0) { sh_invalidid (name); assign_error++; |