🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.4bsd-bugs
Article #6

dd(1) bug

#6
From: ittvaxswatt
Date: Wed, 25 Nov 1981 18:33
39 lines
1298 bytes
Wed Nov 25 18:29:27 EST 1981 (reported by swatt)
 [ ]	Bug in dd(1) "swab" routine prevents swabbing the bytes in the
	last word if the wordsize of a file is odd.  Fix is:

	-----------------------------------------------------------------
	cp /usr/src/cmd/dd.c /tmp/upd.$$.tmp ; chmod +w /tmp/upd.$$.tmp
	ed - /tmp/upd.$$.tmp <<\!xxFUNNYxx
	332c
			c = ((ibc & ~1)>>1);
	.
	1c
	static char *sccsid = "@(#)dd.c	4.2 (ITT) 11/25/81";
	.
	w
	q
	!xxFUNNYxx
	diff /usr/src/cmd/dd.c /tmp/upd.$$.tmp >/tmp/upd.$$.dif
	if cmp - /tmp/upd.$$.dif <<\!xxFUNNYxx
	1c1
	< static char *sccsid = "@(#)dd.c	4.1 (Berkeley) 10/1/80";
	---
	> static char *sccsid = "@(#)dd.c	4.2 (ITT) 11/25/81";
	332c332
	< 		c = (ibc>>1) & ~1;
	---
	> 		c = ((ibc & ~1)>>1);
	!xxFUNNYxx
	then
		: 'compare equal, ok'
		rm -f dd.c
		cp /tmp/upd.$$.tmp dd.c ; chmod a-w dd.c
	else
		echo "Old source file not same version;" \
			"use diff listings by hand"
	fi
	rm -f /tmp/upd.$$.tmp /tmp/upd.$$.dif
	-----------------------------------------------------------------
	[ /bin/dd:
		dd.c	4.1 (Berkeley) 10/1/80 ]
Technical Details
Message-ID: <anews.Aittvax.144>
Path: arc1-ca.pugleaf.net!utzoo!decvax!ittvax!swatt

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!decvax!ittvax!swatt
From: ittvax!swatt
Newsgroups: net.4bsd-bugs,net.v7-bugs
Subject: dd(1) bug
Date: Wed, 25 Nov 1981 18:33:19 +0000
Message-ID: <anews.Aittvax.144>