diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-02-26 13:50:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-02-26 14:07:53 +0300 |
commit | 92c9dbf343c0ac30e28fb660bd8ff9245f8ee345 (patch) | |
tree | 1a615a0690f7d3ebcb8594fa6f2b2349544c87df /source/blender/editors | |
parent | db7bb5bdd25ccbafbe32c097dc9750190e362f15 (diff) |
Cleanup: avoid path copy in XDG support
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_file/fsmenu.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index fb7822fe9ff..94747e79c84 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -192,17 +192,14 @@ static void fsmenu_xdg_insert_entry(GHash *xdg_map, int icon, const char *home) { - char dirpath[FILE_MAXDIR]; - char *xdg_path = xdg_map ? BLI_ghash_lookup(xdg_map, key) : NULL; + char xdg_path_buf[FILE_MAXDIR]; + const char *xdg_path = xdg_map ? BLI_ghash_lookup(xdg_map, key) : NULL; if (xdg_path == NULL) { - BLI_path_join(dirpath, sizeof(dirpath), home, default_path, NULL); + BLI_path_join(xdg_path_buf, sizeof(xdg_path_buf), home, default_path, NULL); + xdg_path = xdg_path_buf; } - else { - STRNCPY(dirpath, xdg_path); - } - fsmenu_insert_entry( - fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, dirpath, IFACE_(default_path), icon, FS_INSERT_LAST); + fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, xdg_path, IFACE_(default_path), icon, FS_INSERT_LAST); } /** \} */ |