Skip to content

Commit fbc6b6c

Browse files
committed
Fix handling of LFN names
Enforce python3 and correctly detect whether a file name needs to use LFN entry.
1 parent dbf1be5 commit fbc6b6c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/mkfat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright (c) 2008 Martin Decky
44
# All rights reserved.
@@ -192,8 +192,8 @@ def fat_lchars(name):
192192
filtered = False
193193

194194
for char in name.encode('ascii', 'replace').upper():
195-
if char in lchars:
196-
filtered_name += char
195+
if chr(char) in lchars:
196+
filtered_name += str.encode(chr(char))
197197
else:
198198
filtered_name += b'_'
199199
filtered = True

0 commit comments

Comments
 (0)