Skip to content

Commit 45eae78

Browse files
Better ordering in initCacheDir
1 parent fb35a6e commit 45eae78

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/common/init.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ static void initConfigDirs(FFstate* state)
2323
ffStrbufTrimRight(buffer, '/');
2424
}
2525

26-
FFstrbuf xdgConfigDirs;
27-
ffStrbufInitA(&xdgConfigDirs, 64);
28-
ffStrbufAppendS(&xdgConfigDirs, getenv("XDG_CONFIG_DIRS"));
29-
3026
#define FF_ENSURE_ONLY_ONCE_IN_LIST(element) \
3127
if(ffListFirstIndexComp(&state->configDirs, element, strbufEqualsAdapter) < state->configDirs.length - 1) \
3228
--state->configDirs.length;
@@ -42,6 +38,10 @@ static void initConfigDirs(FFstate* state)
4238
ffStrbufAppendS(userHome, state->passwd->pw_dir);
4339
FF_ENSURE_ONLY_ONCE_IN_LIST(userHome)
4440

41+
FFstrbuf xdgConfigDirs;
42+
ffStrbufInitA(&xdgConfigDirs, 64);
43+
ffStrbufAppendS(&xdgConfigDirs, getenv("XDG_CONFIG_DIRS"));
44+
4545
uint32_t startIndex = 0;
4646
while (startIndex < xdgConfigDirs.length)
4747
{

0 commit comments

Comments
 (0)