Fix crash when copying empty folders + misc formatting fixes (#65)

This commit is contained in:
Void 2020-08-09 23:45:52 -05:00 committed by GitHub
parent 7e7ae6159a
commit 96b487781a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View File

@ -96,7 +96,7 @@ int fcopy(const char *sourcePath, const char *destinationPath)
chdir(sourcePath);
vector<DirEntry> dirContents;
getDirectoryContents(dirContents);
DirEntry* entry = &dirContents.at(1);
DirEntry* entry = NULL;
mkdir(destinationPath, 0777);
for (int i = 1; i < ((int)dirContents.size()); i++) {

View File

@ -427,7 +427,7 @@ bool fileBrowse_paste(char dest[256]) {
if (pressed & KEY_A) {
char destPath[256];
iprintf ("\x1b[%d;3H", optionOffset + OPTIONS_ENTRIES_START_ROW);
printf(optionOffset ? "Moving..." : "Copying...");
printf(optionOffset ? "Moving... " : "Copying...");
for (auto it = clipboard.begin(); it != clipboard.end(); ++it) {
snprintf(destPath, sizeof(destPath), "%s%s", dest, it->name);
if (!strcmp (it->path, destPath))