From fc2d1d0edd9cd78049d8d049555c4efae6eaa96bf2594ce5bf55e73f6bae26b9 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Tue, 3 Jun 2008 14:13:39 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grep?expand=0&rev=9 --- grep-i18n-speedup.diff | 46 ++++++++++++++++++++---------------------- grep.changes | 5 +++++ grep.spec | 4 +++- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/grep-i18n-speedup.diff b/grep-i18n-speedup.diff index b251d77..fa144ca 100644 --- a/grep-i18n-speedup.diff +++ b/grep-i18n-speedup.diff @@ -416,7 +416,7 @@ #define NCHAR (UCHAR_MAX + 1) -@@ -140,40 +141,62 @@ kwsmusts (void) +@@ -140,40 +141,60 @@ kwsmusts (void) are not single byte character nor the first byte of a multibyte character. Caller must free the array. */ static char* @@ -447,18 +447,22 @@ + wc = buf[i]; + if (case_convert && iswupper ((wint_t)wc)) + wc = towlower ((wint_t) wc); -+ } + } +- else if (match_icase) + else -+ { + { +- if (iswupper((wint_t)wc)) + in_shift = true; + mbclen = mbrtowc(&wc, buf + i, size - i, &cur_state); + + if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0) -+ { + { +- wc = towlower((wint_t)wc); +- wcrtomb(buf + i, wc, &cur_state); + /* An invalid sequence, or a truncated multibyte character. + We treat it as a single byte character. */ + mbclen = 1; -+ } + } + else if (case_convert) + { + if (iswupper((wint_t)wc)) @@ -469,21 +473,15 @@ + } + if (mbsinit (&cur_state)) + in_shift = false; - } -- else if (match_icase) -+ if (mbclen != 1) - { -- if (iswupper((wint_t)wc)) -+ if (!mb_properties) - { -- wc = towlower((wint_t)wc); -- wcrtomb(buf + i, wc, &cur_state); -+ mb_properties = xcalloc (1, size); -+ memset (mb_properties, 1, i); - } -+ mb_properties[i] = mbclen; ++ } ++ if (mbclen != 1 && !mb_properties) ++ { ++ mb_properties = xcalloc (1, size); ++ memset (mb_properties, 1, i); } - mb_properties[i] = mbclen; ++ if (mb_properties) ++ mb_properties[i] = mbclen; i += mbclen; } @@ -492,7 +490,7 @@ } #endif /* MBS_SUPPORT */ -@@ -311,9 +334,8 @@ EXECUTE_FCT(EGexecute) +@@ -311,9 +332,8 @@ EXECUTE_FCT(EGexecute) if (start_ptr) start_ptr = case_buf + (start_ptr - buf); buf = case_buf; @@ -503,7 +501,7 @@ } #endif /* MBS_SUPPORT */ -@@ -336,8 +358,14 @@ EXECUTE_FCT(EGexecute) +@@ -336,8 +356,14 @@ EXECUTE_FCT(EGexecute) end = memchr(beg, eol, buflim - beg); end++; #ifdef MBS_SUPPORT @@ -520,7 +518,7 @@ #endif while (beg > buf && beg[-1] != eol) --beg; -@@ -478,7 +506,7 @@ EXECUTE_FCT(EGexecute) +@@ -478,7 +504,7 @@ EXECUTE_FCT(EGexecute) { if (match_icase) free((char*)buf); @@ -529,7 +527,7 @@ free(mb_properties); } #endif /* MBS_SUPPORT */ -@@ -527,8 +555,8 @@ EXECUTE_FCT(Fexecute) +@@ -527,8 +553,8 @@ EXECUTE_FCT(Fexecute) if (start_ptr) start_ptr = case_buf + (start_ptr - buf); buf = case_buf; @@ -539,7 +537,7 @@ } #endif /* MBS_SUPPORT */ -@@ -538,8 +566,14 @@ EXECUTE_FCT(Fexecute) +@@ -538,8 +564,14 @@ EXECUTE_FCT(Fexecute) if (offset == (size_t) -1) goto failure; #ifdef MBS_SUPPORT @@ -556,7 +554,7 @@ #endif /* MBS_SUPPORT */ beg += offset; len = kwsmatch.size[0]; -@@ -595,7 +629,7 @@ EXECUTE_FCT(Fexecute) +@@ -595,7 +627,7 @@ EXECUTE_FCT(Fexecute) { if (match_icase) free((char*)buf); diff --git a/grep.changes b/grep.changes index a9146ab..10e63f1 100644 --- a/grep.changes +++ b/grep.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jun 3 11:29:37 CEST 2008 - schwab@suse.de + +- Fix last change. + ------------------------------------------------------------------- Tue May 27 18:45:20 CEST 2008 - schwab@suse.de diff --git a/grep.spec b/grep.spec index fb27577..6c99fec 100644 --- a/grep.spec +++ b/grep.spec @@ -20,7 +20,7 @@ Provides: base:/usr/bin/grep AutoReqProv: on PreReq: %{install_info_prereq} Version: 2.5.2 -Release: 69 +Release: 72 Summary: Print lines matching a pattern Source: grep-%{version}.tar.bz2 Patch: grep-%{version}.diff @@ -95,6 +95,8 @@ ln -sf ../../bin/grep $RPM_BUILD_ROOT/usr/bin/grep %doc %{_infodir}/*.gz %changelog +* Tue Jun 03 2008 schwab@suse.de +- Fix last change. * Tue May 27 2008 schwab@suse.de - Some speadups. * Mon Feb 11 2008 schwab@suse.de