From 3353b6d236b40a8bb17a9ce50488d50bdf57553d Mon Sep 17 00:00:00 2001 From: mycroft Date: Sun, 6 Jul 1997 11:19:16 +0000 Subject: [PATCH] Fix parsing error with escaped colons. --- games/quiz/quiz.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/games/quiz/quiz.c b/games/quiz/quiz.c index 60a89264fb0a..5aca0ac38b6e 100644 --- a/games/quiz/quiz.c +++ b/games/quiz/quiz.c @@ -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 @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)quiz.c 8.3 (Berkeley) 5/4/95"; #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 /* not lint */ @@ -300,14 +300,22 @@ char * next_cat(s) register char * s; { + int esc; + + esc = 0; for (;;) switch (*s++) { case '\0': return (NULL); case '\\': + esc = 1; break; case ':': - return (s); + if (!esc) + return (s); + default: + esc = 0; + break; } /* NOTREACHED */ }