From e8d95bb287013c56797f206dd2aff24945ea3514 Mon Sep 17 00:00:00 2001 From: tjr Date: Sat, 14 May 2005 05:35:04 +0000 Subject: Removed redundant (and incorrect) code in prline. Fixes grep -i --color "", among other things. PR: 79063 Obtained from: Fedora (Tim Waugh) --- gnu/usr.bin/grep/grep.c | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'gnu/usr.bin/grep') diff --git a/gnu/usr.bin/grep/grep.c b/gnu/usr.bin/grep/grep.c index b339f1d..04a1667 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) { -- cgit v1.1