[U-Boot] [PATCH 8/8] fs/fat: fix case for FAT shortnames

Stefan Bruens stefan.bruens at rwth-aachen.de
Sun Aug 13 11:25:41 UTC 2017


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 <robdclark at gmail.com>
> ---
>  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


More information about the U-Boot mailing list