From: Toni Wilen Date: Sat, 27 Apr 2019 17:55:53 +0000 (+0300) Subject: Deleting saveimage didn't check if it was also write protected. X-Git-Tag: 4300~231 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=2833e4b60d4b89aa00f5d46d1ab5f6c64a704b7e;p=francis%2Fwinuae.git Deleting saveimage didn't check if it was also write protected. --- diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index d442d24b..cd02061b 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -15681,7 +15681,13 @@ static void deletesaveimage (HWND hDlg, int num) return; p = DISK_get_saveimagepath(workprefs.floppyslots[num].df, -2); if (zfile_exists (p)) { - DeleteFile (p); + if (!DeleteFile(p)) { + struct mystat st; + if (my_stat(p, &st)) { + my_chmod(p, st.mode | FILEFLAG_WRITE); + DeleteFile(p); + } + } if (!full_property_sheet) DISK_reinsert (num); addfloppytype (hDlg, num);