Core: fix the not found error when type the kernel name without the extent.
authorLiu Aleaxander <Aleaxander@gmail.com>
Fri, 12 Jun 2009 07:45:52 +0000 (15:45 +0800)
committerLiu Aleaxander <Aleaxander@gmail.com>
Fri, 12 Jun 2009 07:45:52 +0000 (15:45 +0800)
it will not clear the zf flag when not found the right file, so it will give the
next file search(searching for a different filename extentsion the wrong answer,
so we need do it after every file searching.

well, in fact we should use EAX(the file lenght in bytes) or si(the open_file_t
structure pointer) to indicate if we have successfully found the file or not.

core/fs.c

index cbb2080..617e3e5 100644 (file)
--- a/core/fs.c
+++ b/core/fs.c
@@ -68,7 +68,9 @@ void searchdir(com32sys_t *regs)
     this_fs->fs_ops->searchdir(filename, &file);
     regs->esi.w[0] = OFFS_WRT(file.open_file, 0);
     regs->eax.l = file.file_len;
-    if (!file.file_len)
+    if (file.file_len)
+        regs->eflags.l &= ~EFLAGS_ZF;
+    else
         regs->eflags.l |= EFLAGS_ZF;
 }