Skip to content

Commit e394efd

Browse files
committed
OS (macOS): trims whitespace from full user name
1 parent c10b652 commit e394efd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/util/platform/FFPlatform_unix.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "FFPlatform_private.h"
2+
#include "util/FFstrbuf.h"
23
#include "util/stringUtils.h"
34
#include "fastfetch_config.h"
45
#include "common/io/io.h"
@@ -182,7 +183,11 @@ static void getUserName(FFPlatform* platform, const struct passwd* pwd)
182183

183184
ffStrbufAppendS(&platform->userName, user);
184185

185-
if (pwd) ffStrbufAppendS(&platform->fullUserName, pwd->pw_gecos);
186+
if (pwd)
187+
{
188+
ffStrbufAppendS(&platform->fullUserName, pwd->pw_gecos);
189+
ffStrbufTrimSpace(&platform->fullUserName);
190+
}
186191
}
187192

188193
static void getHostName(FFPlatform* platform, const struct utsname* uts)

0 commit comments

Comments
 (0)