[strings] string_trim makes a copy rather than modifying the pointer

This commit is contained in:
Al
2016-11-28 15:06:07 -08:00
parent d922d9a60a
commit 89f6611c4e
3 changed files with 14 additions and 18 deletions

View File

@@ -11,7 +11,10 @@ char *normalize_string_utf8(char *str, uint64_t options) {
bool have_utf8proc_options = false;
if (options & NORMALIZE_STRING_TRIM) {
string_trim(str);
char *trimmed = string_trim(str);
if (trimmed != NULL) {
str = trimmed;
}
}
if (options & NORMALIZE_STRING_DECOMPOSE) {