summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/cvs/rcs.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index 6b2d2748523..f3c4995be6a 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.187 2006/08/02 03:23:40 ray Exp $ */
+/* $OpenBSD: rcs.c,v 1.188 2006/08/23 20:28:00 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -2417,7 +2417,10 @@ rcs_gettok(RCSFILE *rfp)
*(bp++) = ch;
for (;;) {
ch = getc(pdp->rp_file);
- if (!isalnum(ch) && ch != '_' && ch != '-' &&
+ if (ch == EOF) {
+ type = RCS_TOK_EOF;
+ break;
+ } else if (!isalnum(ch) && ch != '_' && ch != '-' &&
ch != '/') {
ungetc(ch, pdp->rp_file);
break;
@@ -2446,7 +2449,10 @@ rcs_gettok(RCSFILE *rfp)
type = RCS_TOK_STRING;
for (;;) {
ch = getc(pdp->rp_file);
- if (ch == '@') {
+ if (ch == EOF) {
+ type = RCS_TOK_EOF;
+ break;
+ } else if (ch == '@') {
ch = getc(pdp->rp_file);
if (ch != '@') {
ungetc(ch, pdp->rp_file);
@@ -2472,6 +2478,10 @@ rcs_gettok(RCSFILE *rfp)
for (;;) {
ch = getc(pdp->rp_file);
+ if (ch == EOF) {
+ type = RCS_TOK_EOF;
+ break;
+ }
if (bp == pdp->rp_bufend)
break;
if (!isdigit(ch) && ch != '.') {