Skip to content

Commit 1978506

Browse files
committed
Reverse file iteration in the Steam storage
This prevents us from skipping files if they are deleted from within the callback.
1 parent eea8090 commit 1978506

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/storage/steam/SDL_steamstorage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static bool STEAM_EnumerateStorageDirectory(void *userdata, const char *path, SD
105105

106106
bool done = false;
107107
Sint32 count = steam->SteamAPI_ISteamRemoteStorage_GetFileCount(steamremotestorage);
108-
for (Sint32 i = 0; i < count && !done; ++i) {
108+
for (Sint32 i = count; i-- && !done; ) {
109109
const char *file = steam->SteamAPI_ISteamRemoteStorage_GetFileNameAndSize(steamremotestorage, i, NULL);
110110
if (!file) {
111111
continue;

0 commit comments

Comments
 (0)