From b077d634190ea8c500ab4c24233c539292a88764 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Jan 07 2005 14:50:45 +0000 Subject: - Fixed variable shadowing in egf-speedup patch. --- diff --git a/grep-2.5.1-egf-speedup.patch b/grep-2.5.1-egf-speedup.patch index 0728bfd..91ed22d 100644 --- a/grep-2.5.1-egf-speedup.patch +++ b/grep-2.5.1-egf-speedup.patch @@ -164,8 +164,8 @@ + bytes_left = offset; + while (bytes_left) + { -+ size_t len = mbrlen (beg, bytes_left, &mbs); -+ if (len == (size_t) -1 || len == 0) ++ size_t mlen = mbrlen (beg, bytes_left, &mbs); ++ if (mlen == (size_t) -1 || mlen == 0) + { + /* Incomplete character: treat as single-byte. */ + memset (&mbs, '\0', sizeof (mbstate_t)); @@ -174,13 +174,13 @@ + continue; + } + -+ if (len == (size_t) -2) ++ if (mlen == (size_t) -2) + /* Offset points inside multibyte character: + * no good. */ + break; + -+ beg += len; -+ bytes_left -= len; ++ beg += mlen; ++ bytes_left -= mlen; + } + } + else @@ -224,8 +224,8 @@ + bytes_left = offset; + while (bytes_left) + { -+ size_t len = mbrlen (beg, bytes_left, &mbs); -+ if (len == (size_t) -1 || len == 0) ++ size_t mlen = mbrlen (beg, bytes_left, &mbs); ++ if (mlen == (size_t) -1 || mlen == 0) + { + /* Incomplete character: treat as single-byte. */ + memset (&mbs, '\0', sizeof (mbstate_t)); @@ -234,13 +234,13 @@ + continue; + } + -+ if (len == (size_t) -2) ++ if (mlen == (size_t) -2) + /* Offset points inside multibyte character: + * no good. */ + break; + -+ beg += len; -+ bytes_left -= len; ++ beg += mlen; ++ bytes_left -= mlen; + } + } + else @@ -781,16 +781,16 @@ + end = beg + len; + while (end < buf + size) + { -+ size_t len = mbrlen (end, buf + size - end, &mbs); -+ if (len == (size_t) -1 || len == (size_t) -2 || len == 0) ++ size_t mlen = mbrlen (end, buf + size - end, &mbs); ++ if (mlen == (size_t) -1 || mlen == (size_t) -2 || mlen == 0) + { + memset (&mbs, '\0', sizeof (mbstate_t)); -+ len = 1; ++ mlen = 1; + } -+ if (len == 1 && *end == eol) ++ if (mlen == 1 && *end == eol) + break; + -+ end += len; ++ end += mlen; + } } + else diff --git a/grep.spec b/grep.spec index a83e96b..b33230d 100644 --- a/grep.spec +++ b/grep.spec @@ -91,6 +91,7 @@ fi %changelog * Fri Jan 7 2005 Tim Waugh +- Fixed variable shadowing in egf-speedup patch. - Removed redundant (and incorrect) code in prline. * Fri Jan 7 2005 Tim Waugh 2.5.1-46