mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
1a73b41b10
Originally, prepend_drive_to_path was designed to be a macro, and it modified local path variables to point to a temporary buffers. When it was converted into a function, modification to path variables were no longer visible outside of this function. In addition to that, prepend_drive_to_path allocated 2k bytes on the stack for temporary path buffers. This is replaced with path buffers allocated as part of vfs_fat context object. Locking is added around parts of code which use these temporary buffers. Additionally, _lock member of vfs_fat_ctx_t was placed after the variable-sized files array, which caused the first entry in the array to be never used. This change fixes the order of members and adds comments.