Changeset 4372b49 in mainline for uspace/srv/fs/fat/fat_directory.c


Ignore:
Timestamp:
2011-06-21T12:02:24Z (13 years ago)
Author:
Oleg Romanenko <romanenko.oleg@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9553d7d
Parents:
563686b
Message:

Fixes for api and better unicode support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_directory.c

    r563686b r4372b49  
    4141#include <byteorder.h>
    4242#include <mem.h>
     43#include <str.h>
    4344
    4445int fat_directory_block_load(fat_directory_t *);
     
    5859        di->last = false;
    5960
    60         di->lfn_utf16[0] = '\0';
     61        di->wname[0] = '\0';
    6162        di->lfn_offset = 0;
    6263        di->lfn_size = 0;
     
    174175                                                (di->checksum == FAT_LFN_CHKSUM(d))) {
    175176                                                /* Right order! */
    176                                                 di->lfn_offset = fat_lfn_copy_entry(d, di->lfn_utf16,
    177                                                         di->lfn_offset);
     177                                                fat_lfn_copy_entry(d, di->wname, &di->lfn_offset);
    178178                                        } else {
    179179                                                /* Something wrong with order. Skip this long entries set */
     
    190190                                                                (FAT_LFN_COUNT(d) - 1)) + fat_lfn_size(d);
    191191                                                        di->lfn_offset = di->lfn_size;
    192                                                         di->lfn_offset = fat_lfn_copy_entry(d, di->lfn_utf16,
    193                                                                 di->lfn_offset);
     192                                                        fat_lfn_copy_entry(d, di->wname, &di->lfn_offset);
    194193                                                        di->checksum = FAT_LFN_CHKSUM(d);
    195194                                                }
     
    200199                                if (di->long_entry &&
    201200                                        (di->checksum == fat_dentry_chksum(d->name))) {
    202                                         int rc;
    203                                         rc = fat_lfn_convert_name(di->lfn_utf16, di->lfn_size,
    204                                                 (uint8_t*)name, FAT_LFN_NAME_SIZE);
    205                                         if (rc!=EOK)
     201                                        di->wname[di->lfn_size] = '\0';
     202                                        if (utf16_to_str(name, FAT_LFN_NAME_SIZE, di->wname)!=EOK)
    206203                                                fat_dentry_name_get(d, name);
    207204                                }
Note: See TracChangeset for help on using the changeset viewer.