mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-04 12:14:19 +01:00
Global: remove unexpected trailing line endings
Ref: https://github.com/fastfetch-cli/fastfetch/pull/671#issuecomment-1867777472
This commit is contained in:
@@ -281,6 +281,24 @@ void ffStrbufTrimRight(FFstrbuf* strbuf, char c)
|
||||
strbuf->chars[strbuf->length] = '\0';
|
||||
}
|
||||
|
||||
void ffStrbufTrimRightSpace(FFstrbuf* strbuf)
|
||||
{
|
||||
if(strbuf->length == 0)
|
||||
return;
|
||||
|
||||
while(ffStrbufEndsWithFn(strbuf, isspace))
|
||||
--strbuf->length;
|
||||
|
||||
if(strbuf->allocated == 0)
|
||||
{
|
||||
//static string
|
||||
ffStrbufInitNS(strbuf, strbuf->length, strbuf->chars);
|
||||
return;
|
||||
}
|
||||
|
||||
strbuf->chars[strbuf->length] = '\0';
|
||||
}
|
||||
|
||||
void ffStrbufRemoveSubstr(FFstrbuf* strbuf, uint32_t startIndex, uint32_t endIndex)
|
||||
{
|
||||
if(startIndex > strbuf->length || startIndex >= endIndex)
|
||||
|
||||
Reference in New Issue
Block a user