]> git.pld-linux.org Git - packages/grep.git/commitdiff
- patch from RH.
authorkloczek <kloczek@pld-linux.org>
Sun, 5 Nov 2000 23:21:12 +0000 (23:21 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    grep-i18n.patch -> 1.1

grep-i18n.patch [new file with mode: 0644]

diff --git a/grep-i18n.patch b/grep-i18n.patch
new file mode 100644 (file)
index 0000000..855e8b7
--- /dev/null
@@ -0,0 +1,60 @@
+The following patch works around the bug in grep which makes
+
+       grep '[a-c]'
+
+match "B".  Note, this is a bug in grep caused by a bug in the
+standards which do not provide interfaces to get the necessary
+information.  This patch as correct as grep was before (multibyte char
+handling is not 100% correct but that cannot be solved now), future
+changes might increase the speed a bit.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--- grep-2.4.2/src/dfa.c-old   Sat Aug 19 17:55:05 2000
++++ grep-2.4.2/src/dfa.c       Sat Aug 19 17:55:11 2000
+@@ -743,6 +743,7 @@ lex (void)
+             else
+               c2 = c;
++#if 0
+             lo[0] = c;  lo[1] = '\0';
+             hi[0] = c2; hi[1] = '\0';
+             for (c = 0; c < NOTCHAR; c++)
+@@ -761,6 +762,37 @@ lex (void)
+                       }
+                   }
+               }
++#else
++            {
++              char expr[6] = { '[', c, '-', c2, ']', '\0' };
++              regex_t re;
++
++              if (regcomp (&re, expr, case_fold ? REG_ICASE : 0)
++                  == REG_NOERROR)
++                {
++                  for (c = 0; c < NOTCHAR; ++c)
++                    {
++                      char buf[2] = { c, '\0' };
++                      regmatch_t mat;
++
++                      if (regexec (&re, buf, 1, &mat, 0) == REG_NOERROR
++                          && mat.rm_so == 0 && mat.rm_eo == 1)
++                        {
++                          setbit (c, ccl);
++                          if (case_fold)
++                            {
++                              if (ISUPPER (c))
++                                setbit (tolower (c), ccl);
++                              else if (ISLOWER (c))
++                                setbit (toupper (c), ccl);
++                            }
++                        }
++                    }
++
++                  regfree (&re);
++                }
++            }
++#endif
+           skip:
+             ;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This page took 0.032502 seconds and 4 git commands to generate.