Skip to content

Commit 43f10b3

Browse files
committed
nemo-file-utilities.c: Move directory lookup after special case returns
Without this, the function will return early with the home directory as the value before executing the additional conditionals.
1 parent 4a71eb5 commit 43f10b3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libnemo-private/nemo-file-utilities.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -479,18 +479,18 @@ nemo_get_xdg_dir (const char *type)
479479
update_xdg_dir_cache ();
480480
}
481481

482-
for (i = 0 ; cached_xdg_dirs != NULL && cached_xdg_dirs[i].type != NULL; i++) {
483-
if (strcmp (cached_xdg_dirs[i].type, type) == 0) {
484-
return g_strdup (cached_xdg_dirs[i].path);
485-
}
486-
}
487482
if (strcmp ("DESKTOP", type) == 0) {
488483
return g_build_filename (g_get_home_dir (), DESKTOP_DIRECTORY_NAME, NULL);
489484
}
490485
if (strcmp ("TEMPLATES", type) == 0) {
491486
return g_build_filename (g_get_home_dir (), "Templates", NULL);
492487
}
493488

489+
for (i = 0 ; cached_xdg_dirs != NULL && cached_xdg_dirs[i].type != NULL; i++) {
490+
if (strcmp (cached_xdg_dirs[i].type, type) == 0) {
491+
return g_strdup (cached_xdg_dirs[i].path);
492+
}
493+
}
494494
return g_strdup (g_get_home_dir ());
495495
}
496496

0 commit comments

Comments
 (0)