Fix var_assign_re to recognize a call to the 'declare' builtin even when
authorZac Medico <zmedico@gentoo.org>
Sun, 9 Mar 2008 02:36:47 +0000 (02:36 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 9 Mar 2008 02:36:47 +0000 (02:36 -0000)
no options are given.

svn path=/main/trunk/; revision=9456

bin/filter-bash-environment.py

index bac104f13d9753d0ca23a174a83c0f15fc6b3d43..d3434ff0e18d25827324e5d91c0b17c34ccf35b3 100755 (executable)
@@ -9,7 +9,7 @@ here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$')
 func_start_re = re.compile(r'^[-\w]+\s*\(\)\s*$')
 func_end_re = re.compile(r'^\}$')
 
-var_assign_re = re.compile(r'(^|^declare\s+-\S+\s+|^export\s+)([^=\s]+)=("|\')?.*$')
+var_assign_re = re.compile(r'(^|^declare\s+-\S+\s+|^declare\s+|^export\s+)([^=\s]+)=("|\')?.*$')
 close_quote_re = re.compile(r'(\\"|"|\')\s*$')
 readonly_re = re.compile(r'^declare\s+-(\S*)r(\S*)\s+')