Handle copying to the same path

This commit is contained in:
d0k3 2016-05-20 14:12:03 +02:00
parent 84a9f892a9
commit 6a6e28afda
2 changed files with 5 additions and 2 deletions

View File

@ -431,7 +431,10 @@ bool PathCopyWorker(char* dest, char* orig, bool overwrite, bool move) {
strncpy(dname, oname, 256 - (dname - dest));
// check if destination is part of or equal origin
if (strncmp(dest, orig, strnlen(orig, 255)) == 0) {
if (strncmp(dest, orig, 255) == 0) {
if (!ShowInputPrompt(dname, 255 - (dname - dest), "Destination is equal to origin\nChoose another name?"))
return false;
} else if (strncmp(dest, orig, strnlen(orig, 255)) == 0) {
if ((dest[strnlen(orig, 255)] == '/') || (dest[strnlen(orig, 255)] == '\0')) {
ShowPrompt(false, "Error: Destination is part of origin");
return false;

View File

@ -7,7 +7,7 @@
#include "virtual.h"
#include "image.h"
#define VERSION "0.4.4"
#define VERSION "0.4.5"
#define N_PANES 2
#define IMG_DRV "789I"