added strcasecmp() and strcasencmp()
[unix-history] / usr / src / lib / libc / string / strcspn.c
CommitLineData
36b10697
RE
1/*
2 * Copyright (c) 1985 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 */
6
7/*
8 * Sys5 compat routine
9 */
10
2ce81398
DS
11#if defined(LIBC_SCCS) && !defined(lint)
12static char sccsid[] = "@(#)strcspn.c 5.2 (Berkeley) 86/03/09";
36b10697
RE
13#endif
14
15strcspn(s, set)
16 register char *s, *set;
17{
18 register n = 0;
19 register char *p;
20 register c;
21
22 while (c = *s++) {
23 for (p = set; *p; p++)
24 if (c == *p)
25 break;
26 if (*p)
27 return (n);
28 n++;
29 }
30 return (n);
31}