summaryrefslogtreecommitdiff
path: root/lib/libc/string
diff options
context:
space:
mode:
authorseb <seb@NetBSD.org>2007-12-06 22:07:07 +0000
committerseb <seb@NetBSD.org>2007-12-06 22:07:07 +0000
commit975a58878b7d76077e7ed8bdc32efeef35965905 (patch)
treeda901a4eb51d8ba3166aab5301cbcfe2577366f1 /lib/libc/string
parent2220b74719621196ca30903f8b356b00e2fdbb14 (diff)
Fix stresep(3) handling of consecutive quoted delimiter characters.
Approved by christos@
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/stresep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/string/stresep.c b/lib/libc/string/stresep.c
index 6593e0fb402..34946d4409c 100644
--- a/lib/libc/string/stresep.c
+++ b/lib/libc/string/stresep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: stresep.c,v 1.1 2006/08/12 23:49:54 christos Exp $ */
+/* $NetBSD: stresep.c,v 1.2 2007/12/06 22:07:07 seb Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: stresep.c,v 1.1 2006/08/12 23:49:54 christos Exp $");
+__RCSID("$NetBSD: stresep.c,v 1.2 2007/12/06 22:07:07 seb Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -75,7 +75,7 @@ stresep(char **stringp, const char *delim, int esc)
return NULL;
for (tok = s;;) {
c = *s++;
- if (esc != '\0' && c == esc) {
+ while (esc != '\0' && c == esc) {
(void)strcpy(s - 1, s);
c = *s++;
}