-
-
Notifications
You must be signed in to change notification settings - Fork 65
FATDRVCE allows lowercase chars in filename #475
Description
If you create a file/directory using the functions in FATDRVCE (specifically fat_Create), you can use lowercase characters in the name. This is illegal for short (non-LFN) filenames on FAT32 (or any other variant of FAT afaik). This results in files/directories that appear, and can be opened either using fat_OpenFile, or on Linux (and I presume any other Unix system), but that can not be opened on Windows, as they apparently don't exist.
This also means that filenames are case sensitive. If you attempt to open a file named file by opening FILE, it won't work if it was created by fat_Create.
This could be fixed by converting each character of the filename to uppercase using a toupper call before actually creating the file. I noticed poking around in the assembly (fatdrvce.asm) that you already have a function for ensuring filenames are legal before using them (util_get_fat_name). A few toupper calls in there should do it. I'd do it myself and make a pull request if I understood the assembly.
The code I encountered this bug can be found here. I entered a world, took a screenshot by pressing the window button, and then attempted to open the shots folder.