OS (macOS): trims whitespace from full user name

This commit is contained in:
李通洲
2025-09-30 13:19:58 +08:00
parent c10b652a2e
commit e394efdd85
+6 -1
View File
@@ -1,4 +1,5 @@
#include "FFPlatform_private.h"
#include "util/FFstrbuf.h"
#include "util/stringUtils.h"
#include "fastfetch_config.h"
#include "common/io/io.h"
@@ -182,7 +183,11 @@ static void getUserName(FFPlatform* platform, const struct passwd* pwd)
ffStrbufAppendS(&platform->userName, user);
if (pwd) ffStrbufAppendS(&platform->fullUserName, pwd->pw_gecos);
if (pwd)
{
ffStrbufAppendS(&platform->fullUserName, pwd->pw_gecos);
ffStrbufTrimSpace(&platform->fullUserName);
}
}
static void getHostName(FFPlatform* platform, const struct utsname* uts)