From 95a081bf386f90d6433f60309ee9ca35db8df5de Mon Sep 17 00:00:00 2001 From: Sijmen Schoon Date: Tue, 12 Jul 2016 12:28:18 +0200 Subject: [PATCH] Fix drive listing on Windows --- src/windows/loadsave.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/windows/loadsave.c b/src/windows/loadsave.c index 96aba76f89..5dc6c7aa48 100644 --- a/src/windows/loadsave.c +++ b/src/windows/loadsave.c @@ -565,7 +565,7 @@ static void window_loadsave_populate_list(rct_window *w, int includeNewItem, con // If the drive exists, list it loadsave_list_item *listItem = &_listItems[_listItemsCount]; - sprintf(listItem->path, "%c:%c", 'A' + x, ':'); + sprintf(listItem->path, "%c:%c", 'A' + x, platform_get_path_separator()); safe_strcpy(listItem->name, listItem->path, sizeof(listItem->name)); listItem->type = TYPE_DIRECTORY; @@ -585,6 +585,8 @@ static void window_loadsave_populate_list(rct_window *w, int includeNewItem, con char *ch = strrchr(_parentDirectory, separator); if (ch != NULL) *(ch + 1) = '\0'; + else + _parentDirectory[0] = '\0'; // Disable the Up button if the current directory is the root directory if (str_is_null_or_empty(_parentDirectory) && !drives)