/*****
******
**      TITLE:                  SUBSTR - FIND SUBSTRING IN STRING ROUTINE
**	SYSTEM:			COMMON DEC
**	ENTRY POINT:		SUBSTR
**	SOURCE FILE:		SUBSTR.C
**	PROGRAMMER:		Wayne E. Baisley
**	SOFTWARE TREE:		CLIB.STS
**      DATE:                   April 2, 1984
**
**	REVISIONS:	DATE	PROGRAMMER		DESCRIPTION
**			----	--------------	-----------------------------
**
**         1)         04/02/84  W. E. Baisley   Original release.
**
******
*****/

substr (str, sub)
	
char *str;
char *sub;
	
{

	register char *c;
	register char *strp;
	register char *subp;

	for (strp = str; *strp; strp++)	{

		c = strp;
		subp = sub;

		for (;;)	{

			if (!*subp)
				return (strp - str);
			if (*c++ == *subp++)
				continue;
			else
				break;

		}

	}

	return (strp - str);
	
}
/*	CMS GENERATION  CMS REPLACEMENT HISTORY 	*/


/*	CMS GENERATION *1 COMPILER 17-JUL-1984 10:55:37 "[.pccaccnt]"	*/
