🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #18188

PATCH for tr(1v) to fix bug (please apply)

#18188
From: David Megginson
Date: Mon, 25 Mar 1991 16:14
45 lines
2058 bytes
I have found a bug in my tr(1v) clone for MiNT--under some circumstances,
the program will write out the last buffer twice. I am posting this patch
to comp.sys.atari.st and comp.sources.atari.st, and I will post the full
fixed sources and binaries in a week or so (they should take another week
to appear). Until then, could anyone using my tr or wc please send in any
other bugs, comments or requests, so that I can (maybe) incorporate them?
Thank you.

David

Apply this patch to tr.c:

======CUT HERE======

16a17
> /*		-DDEBUG			Trace buffer handling	*/
20c21
< /* $Id: tr.c,v 1.2 1991/03/05 09:01:38 david Exp $ */
---
> /* $Id: tr.c,v 1.3 1991/03/25 07:51:28 david Exp $ */
23a25,27
>  * Revision 1.3  1991/03/25  07:51:28  david
>  * Fixed error in do_translate() which output last buffer twice.
>  *
32c36
< static char * version = "$Id: tr.c,v 1.2 1991/03/05 09:01:38 david Exp $";
---
> static char * version = "$Id: tr.c,v 1.3 1991/03/25 07:51:28 david Exp $";
342c346
< 		if( total_read > 0 )
---
> 		if( total_read > 0 ) {
344c348,352
< 		write(1,buffer2,total_write);
---
> 			write(1,buffer2,total_write);
> 		}
> #ifdef	DEBUG
> fprintf(stderr,"Total read: %ld, Total write: %ld\n",total_read,total_write);
> #endif
-- 
////////////////////////////////////////////////////////////////////////
/  David Megginson                      david@doe.utoronto.ca          /
/  Centre for Medieval Studies          meggin@vm.epas.utoronto.ca     /
////////////////////////////////////////////////////////////////////////
Technical Details
Message-ID: <1991Mar25.161423.24739@doe.utoronto.ca>
Path: arc1-ca.pugleaf.net!utzoo!utdoe!david

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.atari.st,comp.sys.atari.st.tech,comp.sources.atari.st
Path: arc1-ca.pugleaf.net!utzoo!utdoe!david
From: david@doe.utoronto.ca (David Megginson)
Subject: PATCH for tr(1v) to fix bug (please apply)
Message-ID: <1991Mar25.161423.24739@doe.utoronto.ca>
Followup-To: comp.sys.atari.st
Summary: tr prints out the last buffer twice!
Sender: david@doe.utoronto.ca (David Megginson)
Organization: Dictionary of Old English Project - U of Toronto
Date: Mon, 25 Mar 1991 16:14:23 GMT