Fix gm9i/out/ folder being shown after copying a folder there

This commit is contained in:
RocketRobz 2020-03-19 15:56:06 -06:00
parent 933d661566
commit 3d95a6d560

View File

@ -315,10 +315,12 @@ int fileBrowse_A(DirEntry* entry, char path[PATH_MAX]) {
iprintf ("\x1b[%d;3H", optionOffset + OPTIONS_ENTRIES_START_ROW+cursorScreenPos); iprintf ("\x1b[%d;3H", optionOffset + OPTIONS_ENTRIES_START_ROW+cursorScreenPos);
printf("Copying... "); printf("Copying... ");
remove(destPath); remove(destPath);
char sourceFolder[PATH_MAX];
getcwd(sourceFolder, PATH_MAX);
char sourcePath[PATH_MAX]; char sourcePath[PATH_MAX];
getcwd(sourcePath, PATH_MAX); snprintf(sourcePath, sizeof(sourcePath), "%s%s", sourceFolder, entry->name.c_str());
snprintf(sourcePath, sizeof(sourcePath), "%s%s", sourcePath, entry->name.c_str());
fcopy(sourcePath, destPath); fcopy(sourcePath, destPath);
chdir(sourceFolder); // For after copying a folder
} else if (assignedOp[optionOffset] == 2) { } else if (assignedOp[optionOffset] == 2) {
if (access("fat:/gm9i", F_OK) != 0) { if (access("fat:/gm9i", F_OK) != 0) {
iprintf ("\x1b[%d;3H", optionOffset + OPTIONS_ENTRIES_START_ROW+cursorScreenPos); iprintf ("\x1b[%d;3H", optionOffset + OPTIONS_ENTRIES_START_ROW+cursorScreenPos);
@ -335,10 +337,12 @@ int fileBrowse_A(DirEntry* entry, char path[PATH_MAX]) {
iprintf ("\x1b[%d;3H", optionOffset + OPTIONS_ENTRIES_START_ROW+cursorScreenPos); iprintf ("\x1b[%d;3H", optionOffset + OPTIONS_ENTRIES_START_ROW+cursorScreenPos);
printf("Copying... "); printf("Copying... ");
remove(destPath); remove(destPath);
char sourceFolder[PATH_MAX];
getcwd(sourceFolder, PATH_MAX);
char sourcePath[PATH_MAX]; char sourcePath[PATH_MAX];
getcwd(sourcePath, PATH_MAX); snprintf(sourcePath, sizeof(sourcePath), "%s%s", sourceFolder, entry->name.c_str());
snprintf(sourcePath, sizeof(sourcePath), "%s%s", sourcePath, entry->name.c_str());
fcopy(sourcePath, destPath); fcopy(sourcePath, destPath);
chdir(sourceFolder); // For after copying a folder
} else if (assignedOp[optionOffset] == 3) { } else if (assignedOp[optionOffset] == 3) {
nitroMounted = nitroFSInit(entry->name.c_str()); nitroMounted = nitroFSInit(entry->name.c_str());
if (nitroMounted) { if (nitroMounted) {