From: Robert Pengelly Date: Tue, 20 Oct 2026 17:35:51 +0000 (+0100) Subject: Fixed FCB directory searches after changing directories X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=e867ad658514bca6d42abd994a5ecf3ef37b2e61;p=dosemu.git Fixed FCB directory searches after changing directories --- diff --git a/interrupts.c b/interrupts.c index 9061cf0..fa6b272 100644 --- a/interrupts.c +++ b/interrupts.c @@ -5279,7 +5279,24 @@ static void int_21 (CPU8086 *cpu) { char dirpath[260]; fcb_make_current_host_dir (dirpath, sizeof (dirpath)); - slot = fcb_find_slot_lifo (cpu->ds, fcb_off, dirpath); + + if ((slot = fcb_find_slot_lifo (cpu->ds, fcb_off, dirpath)) < 0) { + + int i; + + /* FindNext continues the original search even after CHDIR. */ + for (i = DOS_FCB_SEARCH_MAX - 1; i >= 0; i--) { + + if (dos_fcb_search[i].active && dos_fcb_search[i].dta_seg == cpu->ds && dos_fcb_search[i].dta_off == fcb_off) { + + slot = i; + break; + + } + + } + + } }