[comp.bugs.4bsd] adb may print addresses twice +FIX

jeff@voder.UUCP (12/11/86)

Index:	bin/adb/format.c 4.3BSD

Description:
	When using the 'a' format character (e.g. main,5?ai) the address
	will be printed twice on the first line.
Repeat-By:
	adb /vmunix
	start,5?ai
	$q
Fix:
	The following patch is something of a kludge, fixing the most
	common case (?ai), but breaking the uncommon case (?ia).

	RCS file: RCS/format.c,v
	retrieving revision 1.1
	retrieving revision 1.2
	diff -c -r1.1 -r1.2
	*** /tmp/,RCSt1017123	Wed Dec 10 17:05:28 1986
	--- /tmp/,RCSt2017123	Wed Dec 10 17:05:29 1986
	***************
	*** 45,53 ****
	  
		WHILE icount
		DO  fp=ifp;
	! 	    savdot=dot; init=0;
	  
	! 	    IF init==0 ANDF (exact=(findsym(dot,ptype)==0)) ANDF maxoff
		    THEN printf("\n%s:%16t",cursym->n_un.n_name);
		    FI
	  
	--- 45,53 ----
	  
		WHILE icount
		DO  fp=ifp;
	! 	    savdot=dot;
	  
	! 	    IF (exact=(findsym(dot,ptype)==0)) ANDF init==0 ANDF maxoff
		    THEN printf("\n%s:%16t",cursym->n_un.n_name);
		    FI
	  
	***************
	*** 65,71 ****
			FI
	  
			IF *fp==0 THEN break; FI
	! 		IF exact ANDF dot==savdot ANDF itype==ISP ANDF cursym->n_un.n_name[0]=='_' ANDF *fp=='i'
			THEN exform(1,"x",itype,ptype); fp++; printc(EOR); /* entry mask */
			ELSE fp=exform(fcount,fp,itype,ptype);
			FI
	--- 65,74 ----
			FI
	  
			IF *fp==0 THEN break; FI
	! 		IF init ANDF *fp=='a'
	! 		THEN fp++;
	! 			init=0;
	! 		ELIF exact ANDF dot==savdot ANDF itype==ISP ANDF cursym->n_un.n_name[0]=='_' ANDF *fp=='i'
			THEN exform(1,"x",itype,ptype); fp++; printc(EOR); /* entry mask */
			ELSE fp=exform(fcount,fp,itype,ptype);
			FI
	***************
	*** 83,88 ****
	--- 86,92 ----
		    THEN dot=inkdot(dotinc);
		    FI
		    IF mkfault THEN error(0); FI
	+ 	    init=0;
		OD
	  }
	  
-- 

Jeff Gilliam	{ucbvax,pyramid,nsc}!voder!jeff