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

Rob Clark robdclark at gmail.com
Sun Aug 13 12:14:54 UTC 2017


On Sun, Aug 13, 2017 at 7:25 AM, Stefan Bruens
<stefan.bruens at rwth-aachen.de> wrote:
> 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".
>

oh, whoops.. how did I miss that.

BR,
-R


More information about the U-Boot mailing list