]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Do not move old configuration.backup to trashcan, simply delete it.
authorToni Wilen <twilen@winuae.net>
Fri, 12 Jul 2019 16:39:28 +0000 (19:39 +0300)
committerToni Wilen <twilen@winuae.net>
Fri, 12 Jul 2019 16:39:28 +0000 (19:39 +0300)
cfgfile.cpp
filesys.cpp
include/fsdb.h
od-win32/fsdb_mywin32.cpp
scsitape.cpp

index 8f69b6f9b6b5cef06ceb6bf39efaab3716a7f571..810045ff006d0d3abbd337560684c668e7c3c0b3 100644 (file)
@@ -6615,7 +6615,7 @@ void cfgfile_backup (const TCHAR *path)
        fetch_configurationpath (dpath, sizeof (dpath) / sizeof (TCHAR));
        _tcscat (dpath, _T("configuration.backup"));
        bool hidden = my_isfilehidden (dpath);
-       my_unlink (dpath);
+       my_unlink (dpath, true);
        my_rename (path, dpath);
        if (hidden)
                my_setfilehidden (dpath, hidden);
index 3a7c9d5c907d36137f01cadc803e62121045c108..ba64af8462bc7e3987978aaa4291fbc6da4133a3 100644 (file)
@@ -6015,7 +6015,7 @@ static void       action_delete_object(TrapContext *ctx, Unit *unit, dpacket *packet)
                                return;
                        }
                } else {
-                       if (my_unlink (a->nname) == -1) {
+                       if (my_unlink (a->nname, false) == -1) {
                                PUT_PCK_RES1 (packet, DOS_FALSE);
                                PUT_PCK_RES2 (packet, dos_errno ());
                                return;
index a2797aec0e69b62f686658447cd0ac35a07fe6c5..8308aa20824cbd8e0500e699475af758b18ce390 100644 (file)
@@ -153,7 +153,7 @@ extern int my_readdir (struct my_opendir_s*, TCHAR*);
 
 extern int my_rmdir (const TCHAR*);
 extern int my_mkdir (const TCHAR*);
-extern int my_unlink (const TCHAR*);
+extern int my_unlink (const TCHAR*, bool);
 extern int my_rename (const TCHAR*, const TCHAR*);
 extern int my_setcurrentdir (const TCHAR *curdir, TCHAR *oldcur);
 bool my_isfilehidden (const TCHAR *path);
index 0d6b9e577311df1b1586b4306f2a4f1b95734a9b..22ef1384bf024766199c8cc60c6c79853088234f 100644 (file)
@@ -70,7 +70,7 @@ int my_mkdir (const TCHAR *name)
        return CreateDirectory (namep, NULL) == 0 ? -1 : 0;
 }
 
-static int recycle (const TCHAR *name)
+static int recycle (const TCHAR *name, bool dontrecycle)
 {
        DWORD dirattr = GetFileAttributesSafe (name);
        bool isdir = dirattr != INVALID_FILE_ATTRIBUTES && (dirattr & FILE_ATTRIBUTE_DIRECTORY);
@@ -85,7 +85,7 @@ static int recycle (const TCHAR *name)
                namep = name;
        }
 
-       if (currprefs.win32_norecyclebin || isdir || currprefs.win32_filesystem_mangle_reserved_names == false) {
+       if (dontrecycle || currprefs.win32_norecyclebin || isdir || currprefs.win32_filesystem_mangle_reserved_names == false) {
                if (isdir)
                        return RemoveDirectory (namep) ? 0 : -1;
                else
@@ -162,13 +162,13 @@ int my_rmdir (const TCHAR *name)
                return -1;
        }
 
-       return recycle (name);
+       return recycle (name, false);
 }
 
 /* "move to Recycle Bin" (if enabled) -version of DeleteFile() */
-int my_unlink (const TCHAR *name)
+int my_unlink (const TCHAR *name, bool dontrecycle)
 {
-       return recycle (name);
+       return recycle (name, dontrecycle);
 }
 
 int my_rename (const TCHAR *oldname, const TCHAR *newname)
@@ -944,7 +944,7 @@ bool my_resolveshortcut(TCHAR *linkfile, int size)
                 if (SUCCEEDED(hres)) 
                 { 
                     // Get the path to the link target. 
-                    hres = psl->GetPath(szGotPath, MAX_DPATH, (WIN32_FIND_DATA*)&wfd, SLGP_SHORTPATH);
+                    hres = psl->GetPath(szGotPath, MAX_DPATH, &wfd, SLGP_SHORTPATH);
 
                     if (SUCCEEDED(hres)) 
                     { 
index 5005b18cad24bd6b2c19b291a2cb5877a2641435..fcbb0635cdee7de2784b144619d7e3c9b1c5f6cf 100644 (file)
@@ -199,7 +199,7 @@ static void erase (struct scsi_data_tape *tape)
                        if (ext && !_tcsicmp (ext, _T(".tape"))) {
                                _stprintf (path, _T("%s%s%s"), tape->tape_dir, FSDB_DIR_SEPARATOR_S, filename);
                                if (my_existsfile (path))
-                                       my_unlink (path);
+                                       my_unlink (path, false);
                        }
                }
                my_closedir (od);