Article View: gnu.utils.bug
Article #1166bug fix for find 3.7
From: Joseph H Buehler
Date: Sat, 12 Dec 1992 19:22
Date: Sat, 12 Dec 1992 19:22
55 lines
2145 bytes
2145 bytes
I had been having problems with the "locate" part of GNU find 3.6 and
3.7, running under SVR4.0.3 on a 486 platform. It turned out to be a
bug in the putw() routine in the C library on this platform. The
following patches eliminate usage of this routine in locate/code.c and
locate/locate.c.
Joe Buehler
*** code.c.~1~ Tue Jul 14 01:14:28 1992
--- code.c Sat Dec 12 12:31:14 1992
***************
*** 115,122 ****
--- 115,131 ----
diffcount = count - oldcount;
if (diffcount < -14 || diffcount > 14)
{
+ #ifdef OLDSTUFF
putc (RESET, stdout);
putw (diffcount + 14, stdout);
+ #else
+ int tempint = diffcount + 14;
+ putc (RESET, stdout);
+ putc ((unsigned char)(tempint >> 0), stdout);
+ putc ((unsigned char)(tempint >> 8), stdout);
+ putc ((unsigned char)(tempint >> 16), stdout);
+ putc ((unsigned char)(tempint >> 24), stdout);
+ #endif
}
else
putc (diffcount + 14, stdout);
*** locate.c.~1~ Tue Jul 14 00:25:14 1992
--- locate.c Sat Dec 12 12:32:05 1992
***************
*** 111,117 ****
--- 111,130 ----
c = getc (fp);
while (c != EOF)
{
+ #ifdef OLDSTUFF
count += ((c == ESCCODE) ? getw (fp) : c) - OFFSET;
+ #else
+ if (c == ESCCODE) {
+ int tempint = 0;
+ tempint += ((unsigned int)(unsigned char) getc (fp)) << 0;
+ tempint += ((unsigned int)(unsigned char) getc (fp)) << 8;
+ tempint += ((unsigned int)(unsigned char) getc (fp)) << 16;
+ tempint += ((unsigned int)(unsigned char) getc (fp)) << 24;
+ count += tempint - OFFSET;
+ } else {
+ count += c - OFFSET;
+ }
+ #endif
for (p = path + count; (c = getc (fp)) > ESCCODE;)
/* Overlay old path. */
Technical Details
Message-ID:
<9212122040.AA27689@relay2.UU.NET>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!sarto.budd-lake.nj.US!jhpbShow Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!sarto.budd-lake.nj.US!jhpb From: jhpb@sarto.budd-lake.nj.US (Joseph H Buehler) Subject: bug fix for find 3.7 Message-ID: <9212122040.AA27689@relay2.UU.NET> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Sat, 12 Dec 1992 19:22:15 GMT Approved: bug-gnu-utils@prep.ai.mit.edu Lines: 56