summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-25 13:50:50 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-25 13:50:50 -0700
commitc6b829c3545f2e594804b4ccce4db3398d5dff08 (patch)
treeee202281eabcd292547bad4304b8eb160b2139ff
parent7bce9c47f6561f321d5a371aa38f77749f6bd01e (diff)
downloadsyslinux-c6b829c3545f2e594804b4ccce4db3398d5dff08.tar.gz
ldlinux: handle "first byte E5 change to 05" rule in FAT
FAT has a somewhat obnoxious rule: byte E5 in the first position is encoded as 05. If it was *always* that case we could simply fold it into the codepage tables, but that rule applies only to the first character. Note that in the common codepages (incl. 437), E5 is lower-case sigma (σ), which we currently upper case to upper case sigma (Σ, E4) preventing a match -- which DOS *doesn't* do (it thinks of the Greek characters as symbols, not subject to case distinctions.) Putting that special case in the codepage-generation scripts seems too ugly, though.
-rw-r--r--core/ldlinux.asm6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/ldlinux.asm b/core/ldlinux.asm
index 5a205c07..9cf1c03d 100644
--- a/core/ldlinux.asm
+++ b/core/ldlinux.asm
@@ -1394,7 +1394,11 @@ mangle_dos_name:
cmp al,'.' ; Period -> space-fill
je .is_period
xlatb ; Convert to upper case
- stosb
+ mov ah,cl ; If the first byte (only!)...
+ cmp ax,0BE5h ; ... equals E5 hex ...
+ jne .charok
+ mov al,05h ; ... change it to 05 hex
+.charok: stosb
loop .loop ; Don't continue if too long
; Find the end for the benefit of longname search
.find_end: