From feb621e000658f60be28d38a1d4dd3e9c55a124b Mon Sep 17 00:00:00 2001 From: Todd Jeffreys Date: Mon, 12 Apr 2021 20:57:11 -0600 Subject: [PATCH] Make Int 7Bh queries return KeyValueNotFound when necessary. Queries that specify a key are searchin by key and KeyValueNotFound is a better error than EOF. EOF is still used for queries that are "key-less", such as Next/Previous. Those queries should return EOF. --- MBBSEmu/DOS/Interrupts/Int7Bh.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MBBSEmu/DOS/Interrupts/Int7Bh.cs b/MBBSEmu/DOS/Interrupts/Int7Bh.cs index 9dfa4a23..3ad2afc5 100644 --- a/MBBSEmu/DOS/Interrupts/Int7Bh.cs +++ b/MBBSEmu/DOS/Interrupts/Int7Bh.cs @@ -24,7 +24,7 @@ public enum BtrieveError InvalidKeyNumber = 6, DifferentKeyNumber = 7, InvalidPositioning = 8, - EOF = 9 , + EOF = 9, NonModifiableKeyValue = 10, InvalidFileName = 11, FileNotFound = 12, @@ -418,7 +418,7 @@ private BtrieveError Query(BtrieveCommand command) key = _memory.GetArray(command.key_buffer_segment, command.key_buffer_offset, command.key_buffer_length); if (!db.PerformOperation(command.key_number, key, command.operation)) - return BtrieveError.EOF; + return command.operation.RequiresKey() ? BtrieveError.KeyValueNotFound : BtrieveError.EOF; var data = db.GetRecord();