summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormycroft <mycroft@NetBSD.org>1997-07-06 11:19:16 +0000
committermycroft <mycroft@NetBSD.org>1997-07-06 11:19:16 +0000
commit367ec7f666db2981d2919735dec843f1c6dc6232 (patch)
tree11d680ee74c4edb8e7708b39fc0a4a01a7b0231c
parent2cdbb694c5a0c2ce19ea837343a558e17c413f58 (diff)
downloadbsdgames-darwin-367ec7f666db2981d2919735dec843f1c6dc6232.tar.gz
bsdgames-darwin-367ec7f666db2981d2919735dec843f1c6dc6232.tar.zst
bsdgames-darwin-367ec7f666db2981d2919735dec843f1c6dc6232.zip
Fix parsing error with escaped colons.
-rw-r--r--quiz/quiz.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/quiz/quiz.c b/quiz/quiz.c
index 60a89264..5aca0ac3 100644
--- a/quiz/quiz.c
+++ b/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 */
}