1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[misc] use UTF-8 compatible _unlinkU() when deleting files

This commit is contained in:
Pete Batard 2017-08-30 11:24:47 +01:00
parent bf09842fd2
commit fe3004d17f
5 changed files with 20 additions and 11 deletions

View file

@ -1793,7 +1793,7 @@ DWORD WINAPI FormatThread(void* param)
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_BADBLOCKS_FAILURE); FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_BADBLOCKS_FAILURE);
ClearMBRGPT(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.SectorSize, FALSE); ClearMBRGPT(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.SectorSize, FALSE);
fclose(log_fd); fclose(log_fd);
_unlink(logfile); _unlinkU(logfile);
goto out; goto out;
} }
uprintf("Bad Blocks: Check completed, %d bad block%s found. (%d/%d/%d errors)\n", uprintf("Bad Blocks: Check completed, %d bad block%s found. (%d/%d/%d errors)\n",
@ -1820,7 +1820,7 @@ DWORD WINAPI FormatThread(void* param)
} else { } else {
// We didn't get any errors => delete the log file // We didn't get any errors => delete the log file
fclose(log_fd); fclose(log_fd);
_unlink(logfile); _unlinkU(logfile);
} }
} while (r == IDRETRY); } while (r == IDRETRY);
if (r == IDABORT) { if (r == IDABORT) {

View file

@ -829,7 +829,7 @@ out:
} }
free(buf); free(buf);
} }
_unlink(isolinux_tmp); _unlinkU(isolinux_tmp);
} }
if (img_report.sl_version != 0) { if (img_report.sl_version != 0) {
static_sprintf(img_report.sl_version_str, "%d.%02d", static_sprintf(img_report.sl_version_str, "%d.%02d",
@ -865,7 +865,7 @@ out:
uprintf(" Checking txtsetup.sif:\n OsLoadOptions = %s", tmp); uprintf(" Checking txtsetup.sif:\n OsLoadOptions = %s", tmp);
img_report.uses_minint = (strstr(tmp, "/minint") != NULL); img_report.uses_minint = (strstr(tmp, "/minint") != NULL);
} }
_unlink(tmp_sif); _unlinkU(tmp_sif);
safe_free(tmp); safe_free(tmp);
} }
if (HAS_INSTALL_WIM(img_report)) { if (HAS_INSTALL_WIM(img_report)) {
@ -886,7 +886,7 @@ out:
GetGrubVersion(buf, size); GetGrubVersion(buf, size);
} }
free(buf); free(buf);
_unlink(path); _unlinkU(path);
} }
if (img_report.grub2_version[0] != 0) if (img_report.grub2_version[0] != 0)
uprintf(" Detected Grub version: %s", img_report.grub2_version); uprintf(" Detected Grub version: %s", img_report.grub2_version);

View file

@ -948,6 +948,15 @@ static __inline int _openU(const char *filename, int oflag , int pmode)
} }
#endif #endif
static __inline int _unlinkU(const char *path)
{
int ret;
wconvert(path);
ret = _wunlink(wpath);
wfree(path);
return ret;
}
static __inline int _stat64U(const char *path, struct __stat64 *buffer) static __inline int _stat64U(const char *path, struct __stat64 *buffer)
{ {
int ret; int ret;

View file

@ -358,7 +358,7 @@ out:
if (fd != NULL) fclose(fd); if (fd != NULL) fclose(fd);
if (!r) { if (!r) {
if (file != NULL) if (file != NULL)
_unlink(file); _unlinkU(file);
if (PromptOnError) { if (PromptOnError) {
PrintInfo(0, MSG_242); PrintInfo(0, MSG_242);
SetLastError(error_code); SetLastError(error_code);

View file

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 242, 376 IDD_DIALOG DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 2.17.1185" CAPTION "Rufus 2.17.1186"
FONT 8, "Segoe UI Symbol", 400, 0, 0x0 FONT 8, "Segoe UI Symbol", 400, 0, 0x0
BEGIN BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -366,8 +366,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,17,1185,0 FILEVERSION 2,17,1186,0
PRODUCTVERSION 2,17,1185,0 PRODUCTVERSION 2,17,1186,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -384,13 +384,13 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus" VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "2.17.1185" VALUE "FileVersion", "2.17.1186"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2017 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011-2017 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe" VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus" VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "2.17.1185" VALUE "ProductVersion", "2.17.1186"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"