Fix parsing error with escaped colons.

This commit is contained in:
mycroft 1997-07-06 11:19:16 +00:00
parent 7da56091ad
commit 3353b6d236
1 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: quiz.c,v 1.10 1997/01/07 12:27:30 tls Exp $ */ /* $NetBSD: quiz.c,v 1.11 1997/07/06 11:19:16 mycroft Exp $ */
/*- /*-
* Copyright (c) 1991, 1993 * Copyright (c) 1991, 1993
@ -47,7 +47,7 @@ static char copyright[] =
#if 0 #if 0
static char sccsid[] = "@(#)quiz.c 8.3 (Berkeley) 5/4/95"; static char sccsid[] = "@(#)quiz.c 8.3 (Berkeley) 5/4/95";
#else #else
static char rcsid[] = "$NetBSD: quiz.c,v 1.10 1997/01/07 12:27:30 tls Exp $"; static char rcsid[] = "$NetBSD: quiz.c,v 1.11 1997/07/06 11:19:16 mycroft Exp $";
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -300,14 +300,22 @@ char *
next_cat(s) next_cat(s)
register char * s; register char * s;
{ {
int esc;
esc = 0;
for (;;) for (;;)
switch (*s++) { switch (*s++) {
case '\0': case '\0':
return (NULL); return (NULL);
case '\\': case '\\':
esc = 1;
break; break;
case ':': case ':':
return (s); if (!esc)
return (s);
default:
esc = 0;
break;
} }
/* NOTREACHED */ /* NOTREACHED */
} }