summaryrefslogtreecommitdiff
blob: 2389c9c8348517bee11e872cc0d4294b1ac7b0b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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