fix: Files Computer view supports drive numbers past 19

This commit is contained in:
daniel committed 2026-11-22 08:58:02 +01:00
1 parent 2af2e90606
commit 6b9c18087a
3 files changed
+4 -14

No files matched your search

+2 -8
View File
@@ -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) {
int d = fm->drive_indices[idx];
char dpath[8];
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);
// Drive numbers go past 19 (network drives are 32-47).
snprintf(fm->current_path, sizeof(fm->current_path), "%d:/", fm->drive_indices[idx]);
filemanager_read_dir(fm);
filemanager_push_history(fm);
return;
+1 -5
View File
@@ -109,11 +109,7 @@ static void props_drive_path(int drive, char* out, int out_len) {
out[0] = '\0';
return;
}
if (drive < 10) {
snprintf(out, out_len, "%d:/", drive);
} else {
snprintf(out, out_len, "%d:/", drive);
}
snprintf(out, out_len, "%d:/", drive);
}
static const char* props_type_label(const FileManagerState* fm, int idx) {