Hello,
str_trim does not work as expected for "strange strings", such as a string filled with only white spaces or a string starting with any number of spaces followed by just a single character. Here's some test code that works without assets:
#include "strio.c"
void main() {
STRING* test_str;
//Check empty string + 1 char (does not work)
test_str=str_create(" .");
diag("\n\"");
diag(test_str);
diag("\" -> \"");
str_trim(test_str);
diag(test_str);
diag("\"\n\n");
//Check empty string + 2 chars (works)
str_cpy(test_str," ..");
diag("\n\"");
diag(test_str);
diag("\" -> \"");
str_trim(test_str);
diag(test_str);
diag("\"\n\n");
//Check empty string (does not work)
str_cpy(test_str," ");
diag("\n\"");
diag(test_str);
diag("\" -> \"");
str_trim(test_str);
diag(test_str);
diag("\"\n\n");
sys_exit(NULL);
}
Relevant part of the acklog.txt output:
" ." -> " ."
" .." -> ".."
" " -> " "
Not a big deal, granted, but noteworthy nonetheless. Looking at strio.c, it also doesn't seem like a very hard thing to fix.
Best wishes!