xref: /csrg-svn/usr.bin/mail/index.c (revision 1235)
1*1235Skas /*
2*1235Skas  * Determine the leftmost index of the character
3*1235Skas  * in the string.
4*1235Skas  */
5*1235Skas 
6*1235Skas static char *SccsId = "@(#)index.c	1.1 10/08/80";
7*1235Skas 
8*1235Skas char *
9*1235Skas index(str, ch)
10*1235Skas 	char *str;
11*1235Skas {
12*1235Skas 	register char *cp;
13*1235Skas 	register int c;
14*1235Skas 
15*1235Skas 	for (c = ch, cp = str; *cp; cp++)
16*1235Skas 		if (*cp == c)
17*1235Skas 			return(cp);
18*1235Skas 	return(NOSTR);
19*1235Skas }
20