source: buchla-68k/libsm/strcspn.c@ 109c83b

Last change on this file since 109c83b was 109c83b, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Compiled full ROM in Hatari.

  • Property mode set to 100644
File size: 781 bytes
Line 
1/*
2 ============================================================================
3 strcspn.c -- character scan function ala' Unix(tm)
4 Version 1 -- 1987-02-11 -- D.N. Lynx Crowe
5
6 Return the number of characters in the maximum leading segment
7 of string which consists solely of characters NOT from charset.
8 ============================================================================
9*/
10
11int
12strcspn(string, charset)
13char *string;
14register char *charset;
15{
16 register char *p, *q;
17 register int n = 0;
18
19 for(q = string; *q != '\0'; ++q , ++n) {
20
21 for(p = charset; *p != '\0' && *p != *q; ++p)
22 ;
23
24 if(*p != '\0')
25 break;
26 }
27
28 return(n);
29}
Note: See TracBrowser for help on using the repository browser.