From: Stefan Bruens Date: Sun, 13 Aug 2017 13:25:41 +0200 Subject: [U-Boot] [PATCH 8/8] fs/fat: fix case for FAT shortnames In-Reply-To: <20170813104531.16407-9-robdclark@gmail.com> References: <20170813104531.16407-1-robdclark@gmail.com> <20170813104531.16407-9-robdclark@gmail.com> Message-ID: <1682378.JdXeNk0VVD@pebbles.site> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On Sonntag, 13. August 2017 12:45:28 CEST Rob Clark wrote: > Noticed when comparing our output to linux. There are some lcase bits > which control whether filename and/or extension should be downcase'd. > > Signed-off-by: Rob Clark > --- > fs/fat/fat.c | 11 ++++++++--- > fs/fat/fat_write.c | 4 ++-- > include/fat.h | 3 +++ > 3 files changed, 13 insertions(+), 5 deletions(-) > > diff --git a/fs/fat/fat.c b/fs/fat/fat.c > index 08a066d80d..8e1790a590 100644 > --- a/fs/fat/fat.c > +++ b/fs/fat/fat.c > @@ -31,7 +31,7 @@ static const int vfat_enabled = 0; > /* > * Convert a string to lowercase. > */ > -static void downcase(char *str) > +static void downcase(char *str, unsigned num) > { > while (*str != '\0') { > *str = tolower(*str); > @@ -131,10 +131,16 @@ static void get_name(dir_entry *dirent, char *s_name) > ptr = s_name; This change obviously lacks the actual code to handle num, and it would be nice to have: - a parameter description - a mention that the len may be larger than strlen(str) if str is NULL terminated. And probably, "size_t len" instead of "unsigned num". Regards, Stefan -- Stefan Brüns / Bergstraße 21 / 52062 Aachen home: +49 241 53809034 mobile: +49 151 50412019