From 68e5cf5eb969b30330e355e6f1c2f50efda7a8ff Mon Sep 17 00:00:00 2001 From: Alec Murphy Date: Mon, 3 Mar 2025 13:53:47 -0500 Subject: [PATCH] System/Libraries/String: Use mode instead of always trimming both ends in String.Trim() --- System/Libraries/String.HC | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/System/Libraries/String.HC b/System/Libraries/String.HC index aa827ee..c7714cd 100644 --- a/System/Libraries/String.HC +++ b/System/Libraries/String.HC @@ -132,14 +132,14 @@ Bool @string_trim_ch(U8 s_ch, U8 trim_ch) U0 @string_trim(U8* s, U8 ch = NULL, I64 mode = TRIM_BOTH) { Bool trim_ch = @string_trim_ch(*s, ch); - if (TRIM_BOTH || TRIM_LEFT) { + if (mode == TRIM_BOTH || mode == TRIM_LEFT) { while (trim_ch) { StrCpy(s, s + 1); trim_ch = @string_trim_ch(*s, ch); } } trim_ch = @string_trim_ch(s[StrLen(s) - 1], ch); - if (TRIM_BOTH || TRIM_RIGHT) { + if (mode == TRIM_BOTH || mode == TRIM_RIGHT) { while (trim_ch) { s[StrLen(s) - 1] = NULL; trim_ch = @string_trim_ch(s[StrLen(s) - 1], ch);