Hello, Please accept this updated version of strstr.c as found in the gnu coreutils-5.0
It should run faster than the original strstr.c routine. Originally looked at strstr.c to modify the /* possible ANSI violation */ This appeared as a simple fix of converting ++haystack to haystack--. This however lead to other fixes that resulted in the file you have attached here. As a side comment, There is a BUG with strstr.c If haystack gets truncated or there is no trailing '\0', then strstr will keep looking past the expected string end into unknown space. (there are several routines in string.h that falls into that category, basically all routines looking for a trailing '\0'). I was thinking of fixing it so it wouldn't, but then there is the problem of how big a limit must it accept, 512?, 1024?, as I don't think there is a clear answer for that, I must leave this 'bug' alone, since some of us may accept a string of 512bytes as acceptable, while some of us need to work on strings exceeding 1meg in size.
strstr.tar.gz
Description: GNU Zip compressed data
_______________________________________________ Bug-coreutils mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-coreutils
