mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-23 11:17:03 -04:00
[core] fix unable to format as FAT32 for RTL languages
* This is a "stealth" update for the 3.0 release * The issue was that we are picking the UTF16 file system name from the dropdown, and where we use the "(Default)" suffixed version, it now has an RLE at the beginning which we must skip. * This prevented RTL languages from being able to format a drive as FAT32...
This commit is contained in:
parent
98ada80b1b
commit
dd1bf3b998
3 changed files with 15 additions and 11 deletions
14
src/format.c
14
src/format.c
|
@ -676,15 +676,17 @@ static BOOL FormatDrive(DWORD DriveIndex)
|
|||
BOOL r = FALSE;
|
||||
PF_DECL(FormatEx);
|
||||
PF_DECL(EnableVolumeCompression);
|
||||
char FSType[32], path[MAX_PATH];
|
||||
char FSType[64], path[MAX_PATH];
|
||||
char *locale, *VolumeName = NULL;
|
||||
WCHAR* wVolumeName = NULL;
|
||||
WCHAR wFSType[64];
|
||||
WCHAR wLabel[64];
|
||||
ULONG ulClusterSize;
|
||||
size_t i;
|
||||
size_t i, index;
|
||||
|
||||
GetWindowTextU(hFileSystem, FSType, ARRAYSIZE(FSType));
|
||||
// Skip the RIGHT_TO_LEFT_EMBEDDING mark from LTR languages
|
||||
index = (strncmp(FSType, RIGHT_TO_LEFT_EMBEDDING, sizeof(RIGHT_TO_LEFT_EMBEDDING) - 1) == 0) ? (sizeof(RIGHT_TO_LEFT_EMBEDDING) - 1) : 0;
|
||||
// Might have a (Default) suffix => remove it
|
||||
for (i=strlen(FSType); i>2; i--) {
|
||||
if (FSType[i] == '(') {
|
||||
|
@ -693,9 +695,9 @@ static BOOL FormatDrive(DWORD DriveIndex)
|
|||
}
|
||||
}
|
||||
if ((fs == FS_UDF) && !((dur_mins == 0) && (dur_secs == 0))) {
|
||||
PrintInfoDebug(0, MSG_220, FSType, dur_mins, dur_secs);
|
||||
PrintInfoDebug(0, MSG_220, &FSType[index], dur_mins, dur_secs);
|
||||
} else {
|
||||
PrintInfoDebug(0, MSG_222, FSType);
|
||||
PrintInfoDebug(0, MSG_222, &FSType[index]);
|
||||
}
|
||||
VolumeName = GetLogicalName(DriveIndex, TRUE, TRUE);
|
||||
wVolumeName = utf8_to_wchar(VolumeName);
|
||||
|
@ -727,6 +729,8 @@ static BOOL FormatDrive(DWORD DriveIndex)
|
|||
setlocale(LC_ALL, locale);
|
||||
|
||||
GetWindowTextW(hFileSystem, wFSType, ARRAYSIZE(wFSType));
|
||||
// Again, skip the RIGHT_TO_LEFT_EMBEDDING mark if present
|
||||
index = (wFSType[0] == 0x202b) ? 1 : 0;
|
||||
// We may have a " (Default)" trail
|
||||
for (i=0; i<wcslen(wFSType); i++) {
|
||||
if (wFSType[i] == ' ') {
|
||||
|
@ -750,7 +754,7 @@ static BOOL FormatDrive(DWORD DriveIndex)
|
|||
fs_index = (int)ComboBox_GetItemData(hFileSystem, ComboBox_GetCurSel(hFileSystem));
|
||||
|
||||
uprintf("%s format was selected\n", IsChecked(IDC_QUICK_FORMAT)?"Quick":"Slow");
|
||||
pfFormatEx(wVolumeName, SelectedDrive.MediaType, wFSType, wLabel,
|
||||
pfFormatEx(wVolumeName, SelectedDrive.MediaType, &wFSType[index], wLabel,
|
||||
IsChecked(IDC_QUICK_FORMAT), ulClusterSize, FormatExCallback);
|
||||
|
||||
if ((fs == FS_NTFS) && (enable_ntfs_compression) && (pfEnableVolumeCompression != NULL)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue