diff options
author | Jean-Jacques Hiblot <jjhiblot@ti.com> | 2017-12-21 12:49:47 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-01-10 08:05:51 -0500 |
commit | 2c33b0c7d8deca7e9a907365a59fcbcde531c70d (patch) | |
tree | 80a512cb751f6782c08f2b82774cccba71a28659 /fs/fat/fat_write.c | |
parent | 75db00eea03d5b892c4e69ab17891fca968187d3 (diff) | |
download | u-boot-2c33b0c7d8deca7e9a907365a59fcbcde531c70d.tar.gz u-boot-2c33b0c7d8deca7e9a907365a59fcbcde531c70d.tar.bz2 u-boot-2c33b0c7d8deca7e9a907365a59fcbcde531c70d.zip |
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>
Diffstat (limited to 'fs/fat/fat_write.c')
-rw-r--r-- | fs/fat/fat_write.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c index 9d2e0ed74c..cd65192da5 100644 --- a/fs/fat/fat_write.c +++ b/fs/fat/fat_write.c @@ -842,8 +842,8 @@ static dir_entry *find_directory_entry(fsdata *mydata, int startsect, get_name(dentptr, s_name); - if (strcmp(filename, s_name) - && strcmp(filename, l_name)) { + if (strncasecmp(filename, s_name, sizeof(s_name)) && + strncasecmp(filename, l_name, sizeof(l_name))) { debug("Mismatch: |%s|%s|\n", s_name, l_name); dentptr++; |