[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
declare -f validity checks use var checks, not function checks
From: |
ferringb |
Subject: |
declare -f validity checks use var checks, not function checks |
Date: |
Sun, 21 May 2006 21:10:46 -0700 |
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: i686-pc-linux-gnu-gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H -I. -I. -I./include -I./lib -O2 -pipe -march=athlon-xp -g
uname output: Linux nightcrawler 2.6.15.1 #7 PREEMPT Mon Feb 20 02:17:45 PST
2006 i686 Mobile AMD Sempron(tm) Processor 2600+ AuthenticAMD GNU/Linux
Machine Type: i686-pc-linux-gnu
Bash Version: 3.1
Patch Level: 17
Release Status: release
Description:
Valid function syntax isn't supported by declare; reason is simple,
declare validity check uses legal_identifier always rather then
using it only when applicable; check_identifier should be used instead.
Repeat-By:
x-y() { :; }; declare -f x-y
Fix:
diff -urN bash-3.1/builtins/declare.def bash-3.1-new/builtins/declare.def
--- bash-3.1/builtins/declare.def 2004-11-06 19:42:10.000000000 -0800
+++ bash-3.1-new/builtins/declare.def 2006-05-20 03:45:44.000000000 -0700
@@ -257,7 +257,7 @@
making_array_special = 0;
#endif
- if (legal_identifier (name) == 0)
+ if (check_identifier (list->word, (flags_on & att_function) ? 0 : 1) ==
0)
{
sh_invalidid (name);
assign_error++;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- declare -f validity checks use var checks, not function checks,
ferringb <=