Rewrite WUtils string.c in Rust #3

Merged
trurl merged 7 commits from trurl/wmaker:refactor/wutil-rs-string into refactor/wutil-rs 2025-12-08 12:40:57 -05:00

7 Commits

Author SHA1 Message Date
c298b5f96f Avoid an unnecessary allocation in wtrimspace. 2025-12-08 12:40:33 -05:00
dfd77b11a9 Don't scan ahead unnecessarily in wstrndup. 2025-12-08 12:40:33 -05:00
927cc93e0a Add string.rs to Makefile.am for wutil-rs.
Without this, `make` won't automatically rebuild wutil-rs when string.rs
changes.
2025-12-08 12:40:33 -05:00
d2046de7ff Unit tests for wtokenjoin. 2025-12-08 12:40:33 -05:00
a7a44397a4 Rewrite all functions from WUtils string.c in Rust.
These functions should be gotten rid of as we transition to Rust, but replacing
them with minimally tested Rust code should suffice as a first step.
2025-12-08 12:40:33 -05:00
72a1f8cb9e Throw some comments around the FST table for tokenizing command line.
This is slated for replacement, but it will help to be better documented first.
2025-12-08 12:40:33 -05:00
60902b9222 Use system strlcpy/strlcat instead of packaging our own.
These functions were added to glibc 2.38, so we don't even need to check for
libbsd. There isn't a strong need to worry about supporting older systems
because use of these functions should go away as we rewrite string.c in
Rust. And, apparently, they are not held in high regard historically. That's at
least 2 reasons to be rid of them.
2025-12-08 12:40:33 -05:00