Newsgroups: comp.mail.uucp
Path: utzoo!telly!eci386!woods
From: woods@eci386.uucp (Greg A. Woods)
Subject: Re: Smail2.5 binary search bug
Message-ID: <1991Mar13.211418.20877@eci386.uucp>
Reply-To: woods@eci386.UUCP (Greg A. Woods)
Organization: Elegant Communications Inc.
References: <135800005@cdp>
Date: Wed, 13 Mar 91 21:14:18 GMT

In article <135800005@cdp> brian@cdp.UUCP writes:
> i have just discoverd that the binary search routine in
> smail 2.5 is faulty. it seems it can miss (at least) the
> last line in the paths file. the version i have is:
> 
> **	@(#)defs.h	2.5 (smail) 9/15/87
> 
> my paths file looks like:
> ---------------------file starts below here------------
> cdp	cdp!%s	100
> cdp2	%s	0
> smart-host	cdp!uunet!%s	100
> ---------------------file ends above here--------------
> 
> if i try to feed it "smail -dR anyhost!anyuser" i get:
[a failure to find [smart-host]

I think this bug has been previously discovered, and perhaps there is
a patch for it.  I know I ran into it at one time.

However, if I remember correctly, the bug is only triggered on very
small files, and only on files such as yours where your smart-host
entry is the last thing in the file.

I know that my current copy of smail, with the same SCCS-id and date
as you show above, can correctly find smart-host in the paths file,
and can correctly find the last entry in the file.  Our current paths
file has an even number of records though (23014).
-- 
							Greg A. Woods
woods@{eci386,gate,robohack,ontmoh,tmsoft}.UUCP		ECI and UniForum Canada
+1-416-443-1734 [h]  +1-416-595-5425 [w]  VE3TCP	Toronto, Ontario CANADA
Political speech and writing are largely the defense of the indefensible-ORWELL
