Re: RFC: add a string-desc module

2023-03-28 Thread Bruno Haible
Simon Josefsson wrote: > I think this is a useful contribution, Thanks. > however I see two deal-breakers > for having it in gnulib -- both related to use in libraries. I think > string helpers types/functions like this is useful not only in > applications but also in libraries. Thus: > > 1)

Re: RFC: add a string-desc module

2023-03-28 Thread Bruno Haible
Paul Eggert wrote: > > I'll add a comment regarding printf with the "%.*s" directive. > > That works only if the string lacks NULs Ouch, indeed. > and its length fits into int, > and one must also convert the idx_t length to int (e.g., via a cast > which I find tricky). I've now documented th

new modules string-desc, xstring-desc, string-desc-quotearg

2023-03-28 Thread Bruno Haible
Thanks for the inputs and feedbacks. Here are the new modules string-desc, xstring-desc, string-desc-quotearg that I'm adding. 2023-03-28 Bruno Haible doc: Document string-desc and related modules. * doc/string-desc.texi: New file. * doc/gnulib.texi (Particular M

doc: Fix placement of memset_explicit node

2023-03-28 Thread Bruno Haible
In the HTML-formatted Gnulib documentation, the node for memset_explicit appears as a child node of the one for memset. This is obviously not intended, since memset_explicit and memset are separate functions. This patch fixes it. 2023-03-28 Bruno Haible doc: Fix placement of memset_ex

doc: Update regarding linear string search

2023-03-28 Thread Bruno Haible
Regarding the run-time complexity of the memmem, strstr, strcasestr, wcsstr implementations: - For memmem: It's interesting to see that after glibc and musl, now also FreeBSD, NetBSD, and OpenBSD have adopted the two-way algorithm for O(n) behaviour. - For strcasestr, on the other hand, glibc