You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-shells/bash/files/bash-4.2-extglob-multibyte....

22 lines
955 B

https://bugs.gentoo.org/412867
http://lists.gnu.org/archive/html/bug-bash/2012-04/msg00134.html
From: Andreas Schwab <schwab@linux-m68k.org>
To: Mike Frysinger <vapier@gentoo.org>
Cc: bug-bash@gnu.org
Subject: Re: string replace with multibyte chars and extglob fails with bash-4.2
diff --git a/subst.c b/subst.c
index 9feaa9c..ebd5138 100644
--- a/subst.c
+++ b/subst.c
@@ -4161,7 +4161,7 @@ match_wpattern (wstring, indices, wstrlen, wpat, mtype, sp, ep)
simple = (wpat[0] != L'\\' && wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'[');
#if defined (EXTENDED_GLOB)
if (extended_glob)
- simple |= (wpat[1] != L'(' || (wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'+' && wpat[0] != L'!' && wpat[0] != L'@')); /*)*/
+ simple &= (wpat[1] != L'(' || (wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'+' && wpat[0] != L'!' && wpat[0] != L'@')); /*)*/
#endif
/* If the pattern doesn't match anywhere in the string, go ahead and