Re: strstr(3): add special case for empty needle, as in wcsstr(3)

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

 



Hi Stefan,

On 7/12/21 11:20 AM, Stefan Kanthak wrote:
Hi,

in the section return value, wcsstr(3) provides the following note
for the special case of an empty needle:

<https://man7.org/linux/man-pages/man3/wcsstr.3.html#RETURN_VALUE>

|  Note the special case: If needle is the empty wide-character
|  string, the return value is always haystack itself.

The same note is but missing in strstr(3) and should be added there:

<https://man7.org/linux/man-pages/man3/strstr.3.html#RETURN_VALUE>

|  Note the special case: If needle is the empty string, the return
|  value is always haystack itself.

Thanks, I applied a patch with that addition. What a coincidence! I was looking for that special case this morning, and had to guess it out considering it as a normal case :)

Regards,

Alex

--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/



[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