]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
strstr.3: Document special case for empty needle
authorAlejandro Colomar <alx.manpages@gmail.com>
Wed, 28 Jul 2021 20:20:03 +0000 (22:20 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sat, 7 Aug 2021 23:50:20 +0000 (01:50 +0200)
Reported-by: Stefan Kanthak <stefan.kanthak@nexgo.de>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man3/strstr.3

index e085409c27a24bf3e55c559657f4346a13a3120b..41ee87489271930a8d7c676b8fbb3f061dcde42d 100644 (file)
@@ -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).