* strstr(3): add special case for empty needle, as in wcsstr(3)
@ 2021-07-12 9:20 Stefan Kanthak
2021-07-25 20:33 ` Alejandro Colomar (man-pages)
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Kanthak @ 2021-07-12 9:20 UTC (permalink / raw
To: mtk.manpages, alx.manpages; +Cc: linux-man
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.
regards
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: strstr(3): add special case for empty needle, as in wcsstr(3)
2021-07-12 9:20 strstr(3): add special case for empty needle, as in wcsstr(3) Stefan Kanthak
@ 2021-07-25 20:33 ` Alejandro Colomar (man-pages)
0 siblings, 0 replies; 2+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-07-25 20:33 UTC (permalink / raw
To: Stefan Kanthak; +Cc: linux-man, mtk.manpages
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-25 20:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-12 9:20 strstr(3): add special case for empty needle, as in wcsstr(3) Stefan Kanthak
2021-07-25 20:33 ` Alejandro Colomar (man-pages)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.