Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Oct 7, 2018
1 parent 2edfa7f commit 93cfb60
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion arm9/source/driveOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool flashcardFound(void) {
}

bool bothSDandFlashcard(void) {
if ((access("sd:/", F_OK) == 0) && (access("fat:/", F_OK) == 0)) {
if (sdMounted && flashcardMounted) {
return true;
} else {
return false;
Expand Down
22 changes: 13 additions & 9 deletions arm9/source/file_browse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,13 @@ void showDirectoryContents (const vector<DirEntry>& dirContents, int startRow) {
}
}

int fileBrowse_A(DirEntry* entry) {
int fileBrowse_A(DirEntry* entry, char path[PATH_MAX]) {
int pressed = 0;
int assignedOp[3] = {0};
int optionOffset = 0;
int cursorScreenPos = 0;
int maxCursors = -1;

char path[PATH_MAX];
getcwd(path, PATH_MAX);
printf ("\x1b[0;27H");
printf (" "); // Clear time
consoleInit(NULL, 1, BgType_Text4bpp, BgSize_T_256x256, 15, 0, false, true);
Expand Down Expand Up @@ -426,12 +424,18 @@ string browseForFile (void) {
screenOffset = 0;
fileOffset = 0;
} else {
int getOp = fileBrowse_A(entry);
if (getOp == 0) {
// Return the chosen file
return entry->name;
} else if (getOp == 1 || getOp == 2) {
getDirectoryContents (dirContents); // Refresh directory listing
char path[PATH_MAX];
getcwd(path, PATH_MAX);
if (bothSDandFlashcard() || entry->isApp
|| strcmp (path, (secondaryDrive ? "fat:/gm9i/out/" : "sd:/gm9i/out/")) != 0)
{
int getOp = fileBrowse_A(entry, path);
if (getOp == 0) {
// Return the chosen file
return entry->name;
} else if (getOp == 1 || getOp == 2) {
getDirectoryContents (dirContents); // Refresh directory listing
}
}
}
}
Expand Down

0 comments on commit 93cfb60

Please sign in to comment.