142147Sbostic /*- 242147Sbostic * Copyright (c) 1990 The Regents of the University of California. 334617Sbostic * All rights reserved. 434617Sbostic * 542147Sbostic * %sccs.include.redist.c% 61969Swnj */ 71969Swnj 834617Sbostic #if defined(LIBC_SCCS) && !defined(lint) 9*46613Sbostic static char sccsid[] = "@(#)index.c 5.7 (Berkeley) 02/24/91"; 1034617Sbostic #endif /* LIBC_SCCS and not lint */ 111969Swnj 12*46613Sbostic #include <sys/cdefs.h> 1342147Sbostic #include <string.h> 1442147Sbostic #include <stddef.h> 1534617Sbostic 161969Swnj char * 1743488Sbostic #ifdef STRCHR 1843488Sbostic strchr(p, ch) 1943488Sbostic #else 2034617Sbostic index(p, ch) 2143488Sbostic #endif 22*46613Sbostic register const char *p, ch; 231969Swnj { 2434617Sbostic for (;; ++p) { 2534617Sbostic if (*p == ch) 26*46613Sbostic return((char *)p); 2734617Sbostic if (!*p) 2834617Sbostic return((char *)NULL); 2934617Sbostic } 3034617Sbostic /* NOTREACHED */ 311969Swnj } 32