5
/* trivial token splitter
7
/* #include <split_at.h>
9
/* char *split_at(string, delimiter)
13
/* char *split_at_right(string, delimiter)
17
/* split_at() null-terminates the \fIstring\fR at the first
18
/* occurrence of the \fIdelimiter\fR character found, and
19
/* returns a pointer to the remainder.
21
/* split_at_right() looks for the rightmost delimiter
22
/* occurrence, but is otherwise identical to split_at().
24
/* The result is a null pointer when the delimiter character
29
/* A split_at() routine appears in the TCP Wrapper software
34
/* The Secure Mailer license must be distributed with this software.
37
/* IBM T.J. Watson Research
39
/* Yorktown Heights, NY 10598, USA
42
/* System libraries */
47
/* Utility library. */
51
/* split_at - break string at first delimiter, return remainder */
53
char *split_at(char *string, int delimiter)
57
if ((cp = strchr(string, delimiter)) != 0)
62
/* split_at_right - break string at last delimiter, return remainder */
64
char *split_at_right(char *string, int delimiter)
68
if ((cp = strrchr(string, delimiter)) != 0)