[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fwd: Re: (Another) piece of redundant code]
From: |
Ed Smith |
Subject: |
[Fwd: Re: (Another) piece of redundant code] |
Date: |
Mon, 07 Jul 2003 17:18:13 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 |
-------- Original Message --------
Message-ID: <address@hidden>
Date: Sun, 04 May 2003 16:04:08 +0100
From: Ed Smith <address@hidden>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: address@hidden
Subject: Re: (Another) piece of redundant code
References: <address@hidden> <address@hidden>
In-Reply-To: <address@hidden>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Hi again again,
Sorry to keep pestering you, but I just noticed that if you apply the
last patch I sent you then there is another part of grep.c which is
redundant making the total grep.c diff from 1.81:
536,566d535
< if(match_icase)
< {
< char *buf = (char*) xmalloc (lim - beg);
< char *ibeg = buf;
< char *ilim = ibeg + (lim - beg);
< int i;
< for (i = 0; i < lim - beg; i++)
< ibeg[i] = tolower (beg[i]);
<
< while ((match_offset = (*execute) (ibeg, lim - beg,
&match_size, 1))
< != (size_t) -1)
< {
< char const *b = ibeg + match_offset;
< if (b == lim)
< break;
< if (match_size == 0)
< break;
< if(color_option)
< printf("\33[%sm", grep_color);
< fwrite(b, sizeof (char), match_size, stdout);
< if(color_option)
< fputs("\33[00m", stdout);
< fputs("\n", stdout);
< ibeg = b + match_size;
< }
< free (buf);
< lastout = lim;
< if(line_buffered)
< fflush(stdout);
< return;
< }
592,620d560
< if(match_icase)
< {
< /* Yuck, this is tricky */
< char *buf = (char*) xmalloc (lim - beg);
< char *ibeg = buf;
< char *ilim = ibeg + (lim - beg);
< int i;
< for (i = 0; i < lim - beg; i++)
< ibeg[i] = tolower (beg[i]);
< while ((match_offset = (*execute) (ibeg, ilim-ibeg,
&match_size, 1))
< != (size_t) -1)
< {
< char const *b = beg + match_offset;
< if (b == lim)
< break;
< if (match_size == 0)
< break;
< fwrite (beg, sizeof (char), match_offset, stdout);
< printf ("\33[%sm", grep_color);
< fwrite (b, sizeof (char), match_size, stdout);
< fputs ("\33[00m", stdout);
< beg = b + match_size;
< ibeg = ibeg + match_offset + match_size;
< }
< fwrite (beg, 1, lim - beg, stdout);
< free (buf);
< lastout = lim;
< return;
< }
Regards,
Ed
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fwd: Re: (Another) piece of redundant code],
Ed Smith <=