Skip to content

Fix long browser filenames#718

Merged
GideonZ merged 3 commits into
GideonZ:test-mergefrom
chrisgleissner:fix/long-filenames
Jul 13, 2026
Merged

Fix long browser filenames#718
GideonZ merged 3 commits into
GideonZ:test-mergefrom
chrisgleissner:fix/long-filenames

Conversation

@chrisgleissner

@chrisgleissner chrisgleissner commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #715.

Overview

This PR fixes long filename handling in the Ultimate 64 browser when acting on FAT-backed entries.

User-visible failures before this change:

  • Mount Disk and Run Disk could fail with Opening disk file failed.
  • Rename could fail with ERROR: FILE DOESN'T EXIST.
  • The browser could display long filenames correctly, but still fail to act on them.

Bugs

  1. BrowsableDirEntry::getName() converted browser action names through a fixed 64-byte buffer.
  2. FileInfo::generate_fat_name() did not guarantee NUL termination for direct FAT names.
  3. The shared filesystem path walker still matched entries through a fixed 64-byte scratch buffer, so long direct names could not be resolved reliably even after the browser handed them off.

Fixes

  • Return direct FAT names from BrowsableDirEntry::getName() without truncating them.
  • Keep CBM-name conversion behavior unchanged, but size that conversion buffer from the actual entry length.
  • Make FileInfo::generate_fat_name() always NUL-terminate direct-name output.
  • Widen the common FileSystem::walk_path() FAT-name scratch buffer and pass its full size into generate_fat_name() so shared path resolution handles long names end to end.

Tests

Host unit / regression tests

  • make -C software/filemanager/tests temp-auto-cleanup
  • Added GenerateFatNameKeepsLongDirectNames
  • Added FileManagerHandlesLongDirectNames

Real hardware / e2e verification

The following e2e test was performed against an Ultimate 64 Elite I.

It successfully demonstrates rename and mounting of filenames exceeding 64 chars, specifically the name zzzz_long_filename_browser_regression_0123456789_0123456789_0123456789_0123456789.d64.

Invocation: ./tools/io/filemanager/browser_long_filename_test.py

Output:

[01] seed long-name fixture for rename ... OK
[02] browser rename on long filename ... 
[03] open menu ... OK
OK
[04] reseed long-name fixture for mount ... OK
[05] browser mount on long filename ... 
[06] open menu ... OK
OK
browser_long_filename_test: OK

@chrisgleissner chrisgleissner changed the title [codex] Fix long browser filenames Fix long browser filenames Jul 12, 2026
@chrisgleissner chrisgleissner marked this pull request as ready for review July 12, 2026 23:33
@chrisgleissner

Copy link
Copy Markdown
Contributor Author

Hi @GideonZ ,

as mentioned on #715 , this PR fixes the issue as shared by its reporter.

Thanks for review and merge.

Best,
Christian

@GideonZ GideonZ merged commit b270800 into GideonZ:test-merge Jul 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants