Changeset 87608a5 in mainline for tools/mkfat.py


Ignore:
Timestamp:
2012-04-13T15:09:54Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
47c9a8c
Parents:
3e72e41
Message:

replace illegal 8+3 characters with underscore to be consistent with the HelenOS FAT driver

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/mkfat.py

    r3e72e41 r87608a5  
    190190       
    191191        filtered_name = ''
    192        
    193         for char in name.encode('ascii', 'ignore').upper():
    194                 if not char in lchars:
    195                         continue
    196                
    197                 filtered_name += char
    198        
    199         return filtered_name
     192        filtered = False
     193       
     194        for char in name.encode('ascii', 'replace').upper():
     195                if char in lchars:
     196                        filtered_name += char
     197                else:
     198                        filtered_name += b'_'
     199                        filtered = True
     200       
     201        return (filtered_name, filtered)
    200202
    201203def fat_name83(name, name83_list):
    202204        "Create a 8.3 name for the given name"
    203205       
    204         ascii_name = fat_lchars(name)
     206        ascii_name, lfn = fat_lchars(name)
    205207        ascii_parts = ascii_name.split('.')
    206208       
    207209        short_name = ''
    208210        short_ext = ''
    209         lfn = False
    210211       
    211212        if len(ascii_name) > 11:
Note: See TracChangeset for help on using the changeset viewer.