Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ptsfa!ames!ucbcad!zen!ucbvax!decvax!gsg!lew
From: lew@gsg.UUCP
Newsgroups: comp.bugs.4bsd
Subject: Enhancement (bug fix?) to 4.3 find database generator
Message-ID: <333@gsg.UUCP>
Date: Thu, 9-Jul-87 17:07:07 EDT
Article-I.D.: gsg.333
Posted: Thu Jul  9 17:07:07 1987
Date-Received: Sun, 12-Jul-87 01:56:08 EDT
Lines: 63
Keywords: 4.3 find code bigram portable

Index:	/usr/src/usr.bin/find/code.c (4.3BSD)

Description:
	Bigram database is not portable across machines, i.e., you
	might not be able to read the bigram database that was
	generated on different machine.  This is because find.c reads
	the database with getw() and code.c generates the database
	with putw().  Change it to use getc() make it portable. [See
	patch for find.c]

Repeat-By:
	run updatedb.csh on one machine and move the database onto a
	different type machine (e.g., Vax to PC).  Find will not work
	properly.

Fix:
	Apply the following diff to code.c.  Line numbers may be off
	because of other local changes.

*** code.c.orig	Thu Jul  9 16:56:24 1987
--- code.c.new	Thu Jul  9 16:57:00 1987
***************
*** 40,45
  	int argc; char *argv[];
  {
    	int count, oldcount, diffcount;
  	int j, code;
  	char bigram[3];
  	FILE *fp;

--- 45,51 -----
  	int argc; char *argv[];
  {
    	int count, oldcount, diffcount;
+ 	int high, low;
  	int j, code;
  	char bigram[3];
  	FILE *fp;
***************
*** 67,73
  		diffcount = count - oldcount;
  		if ( (diffcount < -14) || (diffcount > 14) ) {
  			putc ( RESET, stdout );
! 			putw ( diffcount + 14, stdout );
  		}
  		else
  			putc ( diffcount + 14, stdout );	

--- 76,85 -----
  		diffcount = count - oldcount;
  		if ( (diffcount < -14) || (diffcount > 14) ) {
  			putc ( RESET, stdout );
! 			high = (diffcount + 14) >>  8;
! 			low  = (diffcount + 14) & 255;
! 			putc ( high, stdout);
! 			putc ( low,  stdout);
  		}
  		else
  			putc ( diffcount + 14, stdout );	
-- 
----------------------------------------------------------------------
Paul Lew			{olivea,harvard,decvax}!gsg!lew	(UUCP)
General Systems Group, 51 Main Street, Salem, NH 03079	(603) 893-1000