diff --git a/src/system/boot/platform/bios_ia32/stage1.S b/src/system/boot/platform/bios_ia32/stage1.S index bbfeca4f29..3d3e0eec76 100644 --- a/src/system/boot/platform/bios_ia32/stage1.S +++ b/src/system/boot/platform/bios_ia32/stage1.S @@ -647,7 +647,8 @@ kErrorString db "Failed to load OS. Press any key to reboot..." kPathComponents: pathComponent "system" pathComponent "packages" -pathComponent "haiku_loader.hpkg" +kLastPathComponent: +pathComponent "haiku_loader" db 0 @@ -882,10 +883,19 @@ continueMain: push bp sub bp, dx + ; Compare the key length. For the last component we only want to check + ; whether the prefix matches. + cmp cx, bp + jg .skip_key + + cmp di, kLastPathComponent + 1 + je .compare_keys + cmp cx, bp jne .skip_key - ; compare path component (di) with key (si), length cx (== bp) + ; compare path component (di) with key (si), length cx (<= bp) +.compare_keys: pusha repe cmpsb popa diff --git a/src/system/boot/platform/bios_ia32/stage1.bin b/src/system/boot/platform/bios_ia32/stage1.bin index e348e81a55..ba89d0e5e1 100644 Binary files a/src/system/boot/platform/bios_ia32/stage1.bin and b/src/system/boot/platform/bios_ia32/stage1.bin differ