[mw-devel] CVS Update at silver.sucs.org: mw

Finn Wilcox finnw at sucs.org
Sun Nov 16 21:57:25 GMT 2003

CVSROOT:	/usr/local/src/cvs
Module name:	mw
Changes by:	finnw at silver.sucs.org	03/11/16 21:57:25

Modified files:
	src            : read.c 

Log message:
	Fixed a bug which made some messages inaccessible.
	Consider: !cd Notices, !read 5
	read_msg() was doing this:
	posn = (msgnum - data->first)*sizeof(struct Header);
	lseek(headfile, posn, 0);
	Since data->first == 1, this seeks to record #4 which, since tidyup has
	squeezed out messages 3 & 4, contains message 7.  read_msg() then does:
	while (get_data(headfile, head) && head->Ref < msgnum);
	if (head.Ref==msgnum)
	reads the entry for message 7 and gives up.
	We now seek from the end of the file instead.  If there are expunged
	messages in between, we will seek to an earlier message, but the
	get_data() loop will find the one we want.
	Same problem also fixed in get_mesg_header()

More information about the mw-devel mailing list