fix: Files Computer view supports drive numbers past 19
This commit is contained in:
1 parent
2af2e90606
commit
6b9c18087a
3 files changed
+4
-14
No files matched your search
@@ -12,4 +12,4 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define MONTAUK_BUILD_NUMBER 137
|
#define MONTAUK_BUILD_NUMBER 138
|
||||||
@@ -280,14 +280,8 @@ void filemanager_open_entry(FileManagerState* fm, int idx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (filemanager_is_computer_view(fm) && fm->entry_types[idx] == FM_ENTRY_DRIVE) {
|
if (filemanager_is_computer_view(fm) && fm->entry_types[idx] == FM_ENTRY_DRIVE) {
|
||||||
int d = fm->drive_indices[idx];
|
// Drive numbers go past 19 (network drives are 32-47).
|
||||||
char dpath[8];
|
snprintf(fm->current_path, sizeof(fm->current_path), "%d:/", fm->drive_indices[idx]);
|
||||||
if (d < 10) {
|
|
||||||
dpath[0] = '0' + d; dpath[1] = ':'; dpath[2] = '/'; dpath[3] = '\0';
|
|
||||||
} else {
|
|
||||||
dpath[0] = '1'; dpath[1] = '0' + (d - 10); dpath[2] = ':'; dpath[3] = '/'; dpath[4] = '\0';
|
|
||||||
}
|
|
||||||
montauk::strcpy(fm->current_path, dpath);
|
|
||||||
filemanager_read_dir(fm);
|
filemanager_read_dir(fm);
|
||||||
filemanager_push_history(fm);
|
filemanager_push_history(fm);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -109,11 +109,7 @@ static void props_drive_path(int drive, char* out, int out_len) {
|
|||||||
out[0] = '\0';
|
out[0] = '\0';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (drive < 10) {
|
snprintf(out, out_len, "%d:/", drive);
|
||||||
snprintf(out, out_len, "%d:/", drive);
|
|
||||||
} else {
|
|
||||||
snprintf(out, out_len, "%d:/", drive);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char* props_type_label(const FileManagerState* fm, int idx) {
|
static const char* props_type_label(const FileManagerState* fm, int idx) {
|
||||||
|
|||||||
Reference in new issue
Block a user