Skip to content

Support up to 500 character file names#275

Merged
daveallie merged 2 commits intomasterfrom
fix/support-500-char-file-names
Jan 7, 2026
Merged

Support up to 500 character file names#275
daveallie merged 2 commits intomasterfrom
fix/support-500-char-file-names

Conversation

@daveallie
Copy link
Member

Summary

  • Support up to 500 character file names

Additional Context

@daveallie daveallie force-pushed the fix/support-500-char-file-names branch from 438856e to c986641 Compare January 7, 2026 12:37
@daveallie daveallie merged commit 0bae3bb into master Jan 7, 2026
1 check passed
@daveallie daveallie deleted the fix/support-500-char-file-names branch January 7, 2026 12:43
@swwilshub
Copy link
Contributor

swwilshub commented Jan 10, 2026

With escaping for special characters can these exceed 512 bytes for

char output[512];  // Stack buffer - UNSAFE!
constexpr size_t outputSize = sizeof(output);

@daveallie
Copy link
Member Author

Could you explain more about this issue @swwilshub? "Character" probably want's the right word to use in the title, it should really be "byte", we're allocating a 500 byte array for the title and then calling file.getName on the file, from the docs of getName:

  /**
   * Get a file's name followed by a zero byte.
   *
   * \param[out] name An array of characters for the file's name.
   * \param[in] len The size of the array in bytes. The array
   *             must be at least 13 bytes long.  The file's name will be
   *             truncated if the file's name is too long.
   * \return The length of the returned string.
   */

So for files with names longer than 500 bytes, we'd just get a truncated name as before. These changes don't fully solve the issue, but extending it to 500 bytes seems like an acceptable limit to me atm.

yingirene pushed a commit to yingirene/crosspoint-reader that referenced this pull request Jan 16, 2026
## Summary

- Support up to 500 character file names

## Additional Context

- Fixes crosspoint-reader#265
Unintendedsideeffects pushed a commit to Unintendedsideeffects/crosspoint-reader that referenced this pull request Feb 17, 2026
## Summary

- Support up to 500 character file names

## Additional Context

- Fixes crosspoint-reader#265
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.

New epubs added to SD card do not show up in Browse Files menu

2 participants