diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2024-03-29 00:27:11 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2024-03-31 11:07:08 -0400 |
commit | 7dc8d754a26c88f376d67e63b1da1adf5e770817 (patch) | |
tree | 9ce72714c37b0d6b303e95ffcf82c6406a3fd514 /firmware/common/file_internal.c | |
parent | 4f652b49ae239314f6cb7134845d160df31f11c7 (diff) | |
download | rockbox-7dc8d754a26c88f376d67e63b1da1adf5e770817.tar.gz rockbox-7dc8d754a26c88f376d67e63b1da1adf5e770817.zip |
Disable legacy codepage handling in bootloaders
Turn off legacy codepage handling in the filesystem code for
bootloaders, and support ISO-8859-1 (Latin-1) only.
This only affects DOS 8.3 filename parsing when FAT32 long
names are unavailable; long names are Unicode and can always
be decoded properly regardless of this setting.
In reality, bootloaders never supported codepages other than
Latin-1 in the first place. They did contain the code to load
codepages from disk, but had no way to actually change the
codepage away from Latin-1.
Compiling out this useless codepage handling code frees up
precious space for very size-constrained bootloaders like the
Sansa e200v2.
Change-Id: I26b049dd648fed4a0cc61fa938faa84e9816ab7d
Diffstat (limited to 'firmware/common/file_internal.c')
-rw-r--r-- | firmware/common/file_internal.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/common/file_internal.c b/firmware/common/file_internal.c index a73d9beaa2..e4554670af 100644 --- a/firmware/common/file_internal.c +++ b/firmware/common/file_internal.c | |||
@@ -223,6 +223,7 @@ int test_dir_empty_internal(struct filestr_base *stream) | |||
223 | /* iso decode the name to UTF-8 */ | 223 | /* iso decode the name to UTF-8 */ |
224 | void iso_decode_d_name(char *d_name) | 224 | void iso_decode_d_name(char *d_name) |
225 | { | 225 | { |
226 | #ifdef HAVE_FILESYSTEM_CODEPAGE | ||
226 | if (is_dotdir_name(d_name)) | 227 | if (is_dotdir_name(d_name)) |
227 | return; | 228 | return; |
228 | 229 | ||
@@ -232,6 +233,9 @@ void iso_decode_d_name(char *d_name) | |||
232 | /* This MUST be the default codepage thus not something that could be | 233 | /* This MUST be the default codepage thus not something that could be |
233 | loaded on call */ | 234 | loaded on call */ |
234 | iso_decode(shortname, d_name, -1, len + 1); | 235 | iso_decode(shortname, d_name, -1, len + 1); |
236 | #else | ||
237 | (void)d_name; | ||
238 | #endif | ||
235 | } | 239 | } |
236 | 240 | ||
237 | #ifdef HAVE_DIRCACHE | 241 | #ifdef HAVE_DIRCACHE |