[PATCH 27/32] strstr.3: Add special case for empty needle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reported-by: Stefan Kanthak <stefan.kanthak@xxxxxxxx>
Signed-off-by: Alejandro Colomar <alx.manpages@xxxxxxxxx>
---
 man3/strstr.3 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/man3/strstr.3 b/man3/strstr.3
index e085409c2..41ee87489 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).
-- 
2.32.0




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux