Skip to content

Commit 04d6bb2

Browse files
committed
Fix fs logic that resulted in issues
1 parent f42135d commit 04d6bb2

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

source/fs.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,30 @@
1010

1111
bool FS_FileExists(FsFileSystem *fs, const char *path) {
1212
FsFile file;
13-
13+
1414
char temp_path[FS_MAX_PATH];
1515
snprintf(temp_path, FS_MAX_PATH, path);
16-
17-
if (R_FAILED(fsFsOpenFile(fs, temp_path, FS_OPEN_READ, &file)))
18-
return false;
19-
20-
fsFileClose(&file);
21-
return true;
16+
17+
if (R_SUCCEEDED(fsFsOpenFile(fs, temp_path, FS_OPEN_READ, &file))) {
18+
fsFileClose(&file);
19+
return true;
20+
}
21+
22+
return false;
2223
}
2324

2425
bool FS_DirExists(FsFileSystem *fs, const char *path) {
2526
FsDir dir;
26-
27+
2728
char temp_path[FS_MAX_PATH];
2829
snprintf(temp_path, FS_MAX_PATH, path);
29-
30-
if (R_SUCCEEDED(fsFsOpenDirectory(fs, temp_path, FS_DIROPEN_DIRECTORY, &dir)))
31-
return false;
32-
33-
fsDirClose(&dir);
34-
return true;
30+
31+
if (R_SUCCEEDED(fsFsOpenDirectory(fs, temp_path, FS_DIROPEN_DIRECTORY, &dir))) {
32+
fsDirClose(&dir);
33+
return true;
34+
}
35+
36+
return false;
3537
}
3638

3739
Result FS_MakeDir(FsFileSystem *fs, const char *path) {

0 commit comments

Comments
 (0)