From: Alejandro Colomar Date: Wed, 28 Jul 2021 20:20:03 +0000 (+0200) Subject: strstr.3: Document special case for empty needle X-Git-Tag: man-pages-5.13~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec415ad9705fe642d00ea8aa7abcb2f4b47992bd;p=thirdparty%2Fman-pages.git strstr.3: Document special case for empty needle Reported-by: Stefan Kanthak Signed-off-by: Alejandro Colomar Signed-off-by: Michael Kerrisk --- diff --git a/man3/strstr.3 b/man3/strstr.3 index e085409c27..41ee874892 100644 --- a/man3/strstr.3 +++ b/man3/strstr.3 @@ -61,6 +61,14 @@ but ignores the case of both arguments. .SH RETURN VALUE These functions return a pointer to the beginning of the located substring, or NULL if the substring is not found. +.PP +Note the special case: +If +.I needle +is the empty string, +the return value is always +.I haystack +itself. .SH ATTRIBUTES For an explanation of the terms used in this section, see .BR attributes (7).