Tim Waugh 615014
--- grep-2.5.1a/src/search.c.P	2006-02-03 14:08:00.000000000 +0000
Tim Waugh 615014
+++ grep-2.5.1a/src/search.c	2006-02-03 14:11:20.000000000 +0000
Tim Waugh 615014
@@ -1234,8 +1234,9 @@
Tim Waugh 615014
       char eol = eolbyte;
Tim Waugh 615014
       if (!exact)
Tim Waugh 615014
 	{
Tim Waugh 615014
-	  end = memchr (end, eol, buflim - end);
Tim Waugh 615014
-	  end++;
Tim Waugh 615014
+	  while (end < buflim)
Tim Waugh 615014
+	    if (*end++ == eol)
Tim Waugh 615014
+	      break;
Tim Waugh 615014
 	  while (buf < beg && beg[-1] != eol)
Tim Waugh 615014
 	    --beg;
Tim Waugh 615014
 	}