Commit 2c33b0c7d8deca7e9a907365a59fcbcde531c70d

Authored by Jean-Jacques Hiblot
Committed by Tom Rini
1 parent 75db00eea0

fat write: Fixed a problem with the case of file names when writing files

commit 21a24c3bf35b ("fs/fat: fix case for FAT shortnames") made it
possible that get_name() returns file names with some upper cases.
find_directory_entry() must be updated to take this account, and use
case-insensitive functions to compare file names.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

... ... @@ -842,8 +842,8 @@
842 842  
843 843 get_name(dentptr, s_name);
844 844  
845   - if (strcmp(filename, s_name)
846   - && strcmp(filename, l_name)) {
  845 + if (strncasecmp(filename, s_name, sizeof(s_name)) &&
  846 + strncasecmp(filename, l_name, sizeof(l_name))) {
847 847 debug("Mismatch: |%s|%s|\n",
848 848 s_name, l_name);
849 849 dentptr++;