[comp.binaries.ibm.pc.d] Freely distributable uudecode

w8sdz@WSMR-SIMTEL20.ARMY.MIL (Keith Petersen) (12/20/89)

Some users have reported trouble compiling the freely distributable
uudecode I posted.  It seems that Berkeley moved the "index" function
to one of their system libraries and some systems don't have it.

Here is the missing "index" function, excerpted from an earlier freely
distributable uudecode.  Just add it on the end of the uudecode I posted.

---cut-here---

/*
 * Return the ptr in sp at which the character c appears;
 * NULL if not found
 */

#define	NULL	0

char *
index(sp, c)
register char *sp, c;
{
	do {
		if (*sp == c)
			return(sp);
	} while (*sp++);
	return(NULL);
}

---cut-here---

--Keith Petersen
Maintainer of SIMTEL20's CP/M, MSDOS, & MISC archives [IP address 26.2.0.74]
Internet: w8sdz@WSMR-SIMTEL20.Army.Mil, w8sdz@brl.arpa  BITNET: w8sdz@NDSUVM1
Uucp: {ames,decwrl,harvard,rutgers,ucbvax,uunet}!wsmr-simtel20.army.mil!w8sdz

bobcloud@ficc.uu.net (bob cloud) (12/20/89)

In article above w8sdz@WSMR-SIMTEL20.ARMY.MIL (Keith Petersen) writes:
> Some users have reported trouble compiling the freely distributable
> uudecode I posted.  It seems that Berkeley moved the "index" function
-----text deleted-------
On the Xenix system here,  the following fix corrected the index error.

/* single character decode */
#define index strchr  /* <--- added this line to correct the problem */
#define DEC(c)	(((c) - ' ') & 077)

There were no other changes required.  It compiled and ran exactly as the
other version except for no checksum errors on files with "M" at the ends
of the lines.  The output files were the same size.

WTYFYS (We Thank You For Your Support). BC (713) 274-5530
Bob Cloud - Ferranti International Controls - Houston, Texas