diff options
Diffstat (limited to 'src/regress/lib/libc/regex/split.c')
-rw-r--r-- | src/regress/lib/libc/regex/split.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/regress/lib/libc/regex/split.c b/src/regress/lib/libc/regex/split.c index 52cb6c681e..1e17a55b89 100644 --- a/src/regress/lib/libc/regex/split.c +++ b/src/regress/lib/libc/regex/split.c | |||
@@ -1,19 +1,17 @@ | |||
1 | /* $OpenBSD: split.c,v 1.2 2001/01/29 02:05:44 niklas Exp $ */ | 1 | /* $OpenBSD: split.c,v 1.3 2003/07/31 21:48:03 deraadt Exp $ */ |
2 | /* $NetBSD: split.c,v 1.2 1995/04/20 22:39:57 cgd Exp $ */ | 2 | /* $NetBSD: split.c,v 1.2 1995/04/20 22:39:57 cgd Exp $ */ |
3 | 3 | ||
4 | #include <stdio.h> | 4 | #include <stdio.h> |
5 | #include <string.h> | 5 | #include <string.h> |
6 | 6 | ||
7 | int split(char *string, char *fields[], int nfields, char *sep); | ||
8 | |||
7 | /* | 9 | /* |
8 | - split - divide a string into fields, like awk split() | 10 | - split - divide a string into fields, like awk split() |
9 | = int split(char *string, char *fields[], int nfields, char *sep); | 11 | = int split(char *string, char *fields[], int nfields, char *sep); |
10 | */ | 12 | */ |
11 | int /* number of fields, including overflow */ | 13 | int /* number of fields, including overflow */ |
12 | split(string, fields, nfields, sep) | 14 | split(char *string, char *fields[], int nfields, char *sep) |
13 | char *string; | ||
14 | char *fields[]; /* list is not NULL-terminated */ | ||
15 | int nfields; /* number of entries available in fields[] */ | ||
16 | char *sep; /* "" white, "c" single char, "ab" [ab]+ */ | ||
17 | { | 15 | { |
18 | register char *p = string; | 16 | register char *p = string; |
19 | register char c; /* latest character */ | 17 | register char c; /* latest character */ |