]> git.ipfire.org Git - thirdparty/kmod.git/commit
strbuf: Add strbuf_shrink_to()
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 14 Nov 2024 05:02:07 +0000 (23:02 -0600)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Sun, 17 Nov 2024 21:35:13 +0000 (15:35 -0600)
commit14ce34d755f828feb89381777a9170d5839cca61
treecba7606fd8199a31e0feb205d866f3a1e844dcfa
parent5706fb7d61d25255eab589b3533182b8e98378c8
strbuf: Add strbuf_shrink_to()

Useful when working with paths on a loop and resetting to a base path
component on every loop iteration.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/239
shared/strbuf.c
shared/strbuf.h
testsuite/test-strbuf.c