diff options
| author | deraadt <> | 2003-07-31 21:48:04 +0000 |
|---|---|---|
| committer | deraadt <> | 2003-07-31 21:48:04 +0000 |
| commit | 33c506bfed3ead4cc96819ce600895082c214755 (patch) | |
| tree | f684ac5f268a986ffa67596e223c418beaac533a /src/regress/lib/libc/regex/split.c | |
| parent | 1e17357c09b2a156a0fa1407b68c4158394b9d7e (diff) | |
| download | openbsd-33c506bfed3ead4cc96819ce600895082c214755.tar.gz openbsd-33c506bfed3ead4cc96819ce600895082c214755.tar.bz2 openbsd-33c506bfed3ead4cc96819ce600895082c214755.zip | |
various cleanups; david says results are same
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 */ |
