diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-02-26 10:17:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-02-26 10:18:57 +0300 |
commit | de8062053d3c40dc05961124418a53b67afed90e (patch) | |
tree | c593bcd111b8120c9ffdb5e2e2513564a1acf5bc /source/blender/editors/space_file | |
parent | 48816d462eedc254d439608431fde78d74f2f518 (diff) |
Cleanup: remove trailing slash from bookmarks
This isn't needed.
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r-- | source/blender/editors/space_file/fsmenu.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 80ea0c190e2..f523c253a9e 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -809,10 +809,9 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks) if (read_bookmarks && home) { - BLI_snprintf(line, sizeof(line), "%s/", home); - if (BLI_exists(line)) { + if (BLI_exists(home)) { fsmenu_insert_entry( - fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, line, IFACE_("Home"), ICON_HOME, FS_INSERT_LAST); + fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, home, IFACE_("Home"), ICON_HOME, FS_INSERT_LAST); } /* Follow the XDG spec, check if these are available. */ @@ -844,7 +843,6 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks) # ifdef __linux__ /* loop over mount points */ struct mntent *mnt; - int len; FILE *fp; fp = setmntent(MOUNTED, "r"); @@ -866,16 +864,8 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks) continue; } - len = strlen(mnt->mnt_dir); - if (len && mnt->mnt_dir[len - 1] != '/') { - BLI_snprintf(line, sizeof(line), "%s/", mnt->mnt_dir); - fsmenu_insert_entry( - fsmenu, FS_CATEGORY_SYSTEM, line, NULL, ICON_DISK_DRIVE, FS_INSERT_SORTED); - } - else { - fsmenu_insert_entry( - fsmenu, FS_CATEGORY_SYSTEM, mnt->mnt_dir, NULL, ICON_DISK_DRIVE, FS_INSERT_SORTED); - } + fsmenu_insert_entry( + fsmenu, FS_CATEGORY_SYSTEM, mnt->mnt_dir, NULL, ICON_DISK_DRIVE, FS_INSERT_SORTED); found = 1; } @@ -903,7 +893,7 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks) const char *label_test = label + 6; label = *label_test ? label_test : dirname; } - BLI_snprintf(line, sizeof(line), "%s%s/", name, dirname); + BLI_snprintf(line, sizeof(line), "%s%s", name, dirname); fsmenu_insert_entry( fsmenu, FS_CATEGORY_SYSTEM, line, label, ICON_NETWORK_DRIVE, FS_INSERT_SORTED); found = 1; |