Changeset 49eb6061 in rtems


Ignore:
Timestamp:
Mar 16, 2017, 6:37:20 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11
Children:
7011f26
Parents:
5ed41a6
git-author:
Sebastian Huber <sebastian.huber@…> (03/16/17 06:37:20)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/21/17 15:15:09)
Message:

dosfs: msdos_filename_utf8_to_short_name_for_save

Simplify.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/dosfs/msdos_conv.c

    r5ed41a6 r49eb6061  
    289289msdos_get_valid_codepage_filename_character (const uint8_t character)
    290290{
    291   return codepage_valid_char_map[(unsigned int)character];
     291  char c = codepage_valid_char_map[character];
     292
     293  if (c == 0) {
     294    c = '_';
     295  }
     296
     297  return c;
    292298}
    293299
     
    557563  char          *dest_ptr                = (char*)short_name;
    558564  unsigned int   i;
    559   char           c;
    560565  size_t         name_size_tmp;
    561566  char           name_to_format_buf[MSDOS_SHORT_NAME_LEN +1];
     
    607612        else if ( 0xE5 == *name_ptr )
    608613          dest_ptr[0] = 0x05;
    609         else if (0 != (c = msdos_get_valid_codepage_filename_character( *name_ptr ) ) )
    610           dest_ptr[0] = c;
    611614        else
    612           dest_ptr[0] = '_';
     615          dest_ptr[0] = msdos_get_valid_codepage_filename_character(*name_ptr);
    613616        ++name_ptr;
    614617        ++returned_size;
     
    618621         */
    619622        for (i = 1; i <= 7 && name_size && *name_ptr != '.'; ++i) {
    620           c = msdos_get_valid_codepage_filename_character ( *name_ptr );
    621           if (c != 0)
    622             dest_ptr[i] = c;
    623           else
    624             dest_ptr[i] = '_';
     623          dest_ptr[i] = msdos_get_valid_codepage_filename_character(*name_ptr);
    625624          ++name_ptr;
    626625          ++returned_size;
     
    645644         */
    646645        for (; i <= 10 && name_size ; i++) {
    647           c = msdos_get_valid_codepage_filename_character ( *name_ptr);
    648           if (c != 0)
    649             dest_ptr[i] = c;
    650           else
    651             dest_ptr[i] = '_';
     646          dest_ptr[i] = msdos_get_valid_codepage_filename_character(*name_ptr);
    652647          ++name_ptr;
    653648          ++returned_size;
Note: See TracChangeset for help on using the changeset viewer.