aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2005-05-14 05:35:04 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2005-05-14 05:35:04 +0000
commit712fe40aed1425a130e01603d1e49359670ca3f2 (patch)
tree3a4a87d023ca359d8284cd79a53b85a608fe7fcd /gnu
parent833d4d167b456efce3697ceac372a3f9c528a463 (diff)
downloadsrc-712fe40aed1425a130e01603d1e49359670ca3f2.tar.gz
src-712fe40aed1425a130e01603d1e49359670ca3f2.zip
Removed redundant (and incorrect) code in prline. Fixes grep -i --color "",
among other things. PR: 79063 Obtained from: Fedora (Tim Waugh)
Notes
Notes: svn path=/head/; revision=146204
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/grep/grep.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/gnu/usr.bin/grep/grep.c b/gnu/usr.bin/grep/grep.c
index b339f1d319b6..04a166720420 100644
--- a/gnu/usr.bin/grep/grep.c
+++ b/gnu/usr.bin/grep/grep.c
@@ -631,33 +631,6 @@ prline (char const *beg, char const *lim, int sep)
{
size_t match_size;
size_t match_offset;
- 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;
- 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;
- }
while (lim-beg && (match_offset = (*execute) (beg, lim - beg, &match_size, 1))
!= (size_t) -1)
{