Global: remove unexpected trailing line endings

Ref: https://github.com/fastfetch-cli/fastfetch/pull/671#issuecomment-1867777472
This commit is contained in:
Carter Li
2023-12-23 00:06:37 +08:00
committed by 李通洲
parent e85a4b9ff5
commit cf98e6f5a1
12 changed files with 85 additions and 79 deletions
+7
View File
@@ -55,6 +55,7 @@ FF_C_PRINTF(2, 3) void ffStrbufSetF(FFstrbuf* strbuf, const char* format, ...);
void ffStrbufTrimLeft(FFstrbuf* strbuf, char c);
void ffStrbufTrimRight(FFstrbuf* strbuf, char c);
void ffStrbufTrimRightSpace(FFstrbuf* strbuf);
void ffStrbufRemoveSubstr(FFstrbuf* strbuf, uint32_t startIndex, uint32_t endIndex);
void ffStrbufRemoveS(FFstrbuf* strbuf, const char* str);
@@ -454,6 +455,12 @@ static inline FF_C_NODISCARD bool ffStrbufEndsWithS(const FFstrbuf* strbuf, cons
return ffStrbufEndsWithNS(strbuf, (uint32_t) strlen(end), end);
}
static inline FF_C_NODISCARD bool ffStrbufEndsWithFn(const FFstrbuf* strbuf, int (*fn)(int))
{
return strbuf->length == 0 ? false :
fn(strbuf->chars[strbuf->length - 1]);
}
static inline FF_C_NODISCARD bool ffStrbufEndsWith(const FFstrbuf* strbuf, const FFstrbuf* end)
{
return ffStrbufEndsWithNS(strbuf, end->length, end->chars);