🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs.2bsd
Article #41

Bug in diff

#41
From: cincyroot
Date: Mon, 19 Apr 1982 23:11
14 lines
701 bytes
The following bug is in the 2.8BSD diff:  When a diff -r is done,
the directories are sorted by qsort before comparisons are done.
The second argument to qsort is a long (because st_size is long,)
but qsort wants an int.  The arguments get screwed up and the sort
never happens...  The fix is as follows:

diff diffdir.c diffdir.old

198c198
< 	qsort(dp, (int)( stb.st_size / sizeof (struct direct) ), 
---
> 	qsort(dp, stb.st_size / sizeof (struct direct), 

	Jim Reuter
Technical Details
Message-ID: <anews.Acincy.1017>
Path: arc1-ca.pugleaf.net!utzoo!decvax!ucbvax!mhtsa!ihnss!harpo!eagle!mhuxt!cbosg!cincy!root

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!decvax!ucbvax!mhtsa!ihnss!harpo!eagle!mhuxt!cbosg!cincy!root
From: cincy!root
Newsgroups: net.bugs.2bsd
Subject: Bug in diff
Date: Mon, 19 Apr 1982 23:11:13 +0000
Message-ID: <anews.Acincy.1017>