From 400726deef57d8da8d6c7cd5c8e7891eaabab041 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Mon, 28 May 2012 22:50:15 -0700 Subject: Detect EOL on-the-fly in strstr, strcasestr and memmem. --- string/strstr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'string/strstr.c') diff --git a/string/strstr.c b/string/strstr.c index 10e6fdc7f9..ec2a1e91e7 100644 --- a/string/strstr.c +++ b/string/strstr.c @@ -1,6 +1,5 @@ /* Return the offset of one string within another. - Copyright (C) 1994,1996,1997,2000,2001,2003,2008,2009 - Free Software Foundation, Inc. + Copyright (C) 1994-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -36,6 +35,9 @@ #define AVAILABLE(h, h_l, j, n_l) \ (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \ && ((h_l) = (j) + (n_l))) +#define AVAILABLE1(h, h_l, j, n_l) (true) +#define AVAILABLE2(h, h_l, j, n_l) AVAILABLE (h, h_l, j, n_l) +#define RET0_IF_0(a) if (!a) goto ret0 #include "str-two-way.h" #undef strstr -- cgit v1.2.3-70-g09d2