Sophie

Sophie

distrib > Mandriva > 2009.0 > x86_64 > media > main-testing-src > by-pkgid > 502a95cb633abbd4dd03251ebb30cc91 > files > 3

grep-2.5.4-1mdv2009.0.src.rpm

--- ./src/dfa.c.orig	2004-10-19 01:52:09.000000000 +0900
+++ ./src/dfa.c	2004-10-19 01:59:43.000000000 +0900
@@ -547,6 +547,17 @@
 		/* build character class.  */
 		{
 		  wctype_t wt;
+		  /* NOTE:
+		   * when case_fold, character class [:upper:] and [:lower:]
+		   * should be treated as [:alpha:], this is the same way
+		   * of glibc/posix/regcomp.c:build_charclass().
+		   * reported by Bug#276202
+		   * - fixed by Fumitoshi UKAI
+		   */
+		  if (case_fold 
+		      && (strcmp (str, "upper") == 0 || strcmp (str, "lower") == 0)) 
+		      strcpy (str, "alpha");
+
 		  /* Query the character class as wctype_t.  */
 		  wt = wctype (str);