summaryrefslogtreecommitdiff
path: root/lib/libc/string
diff options
context:
space:
mode:
authoryamt <yamt@NetBSD.org>2002-08-11 09:36:15 +0000
committeryamt <yamt@NetBSD.org>2002-08-11 09:36:15 +0000
commit0da40e1ed0701123a1b656138877ccd47480c42e (patch)
tree6c1a37c3b67df8bbe229a8005045b06b40119898 /lib/libc/string
parent10a7dd0256df05384ebfeb2ac587f53a362d8710 (diff)
- correct how to check empty field.
- improve examples. from OpenBSD.
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/strsep.314
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/libc/string/strsep.3 b/lib/libc/string/strsep.3
index 245f22d0ee2..ae9e2bdfc4f 100644
--- a/lib/libc/string/strsep.3
+++ b/lib/libc/string/strsep.3
@@ -33,9 +33,9 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)strsep.3 8.1 (Berkeley) 6/9/93
-.\" $NetBSD: strsep.3,v 1.10 2002/02/07 09:24:07 ross Exp $
+.\" $NetBSD: strsep.3,v 1.11 2002/08/11 09:36:15 yamt Exp $
.\"
-.Dd June 9, 1993
+.Dd August 11, 2002
.Dt STRSEP 3
.Os
.Sh NAME
@@ -67,8 +67,8 @@ is returned.
.Pp
An ``empty'' field, i.e. one caused by two adjacent delimiter characters,
can be detected by comparing the location referenced by the pointer returned
-in
-.Fa *stringp
+by
+.Fn strsep
to
.Ql \e0 .
.Pp
@@ -87,9 +87,11 @@ argument vector:
.Bd -literal -offset indent
char **ap, *argv[10], *inputstring;
-for (ap = argv; (*ap = strsep(\*[Am]inputstring, " \et")) != NULL;)
+for (ap = argv; ap < \*[Am]argv[9] \*[Am]\*[Am]
+ (*ap = strsep(\*[Am]inputstring, " \et")) != NULL;) {
if (**ap != '\e0')
- ++ap;
+ ap++;
+}
.Ed
.Sh HISTORY
The