diff --git a/usr.bin/ctags/C.c b/usr.bin/ctags/C.c index d2e94b22d7f7..4cdae0145c25 100644 --- a/usr.bin/ctags/C.c +++ b/usr.bin/ctags/C.c @@ -1,4 +1,4 @@ -/* $NetBSD: C.c,v 1.13 2005/07/20 17:22:45 ross Exp $ */ +/* $NetBSD: C.c,v 1.14 2006/04/05 20:03:14 dsl Exp $ */ /* * Copyright (c) 1987, 1993, 1994 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)C.c 8.4 (Berkeley) 4/2/94"; #else -__RCSID("$NetBSD: C.c,v 1.13 2005/07/20 17:22:45 ross Exp $"); +__RCSID("$NetBSD: C.c,v 1.14 2006/04/05 20:03:14 dsl Exp $"); #endif #endif /* not lint */ @@ -150,10 +150,11 @@ c_entries(void) */ case '(': do c = getc(inf); - while(iswhite(c)); + while (c != EOF && iswhite(c)); if (c == '*') break; - else ungetc(c, inf); + if (c != EOF) + ungetc(c, inf); if (!level && token) { int curline; diff --git a/usr.bin/ctags/yacc.c b/usr.bin/ctags/yacc.c index 46ded5b394a2..9d12e86bf1e7 100644 --- a/usr.bin/ctags/yacc.c +++ b/usr.bin/ctags/yacc.c @@ -1,4 +1,4 @@ -/* $NetBSD: yacc.c,v 1.10 2005/02/17 17:29:58 xtraeme Exp $ */ +/* $NetBSD: yacc.c,v 1.11 2006/04/05 20:03:14 dsl Exp $ */ /* * Copyright (c) 1987, 1993, 1994 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)yacc.c 8.3 (Berkeley) 4/2/94"; #else -__RCSID("$NetBSD: yacc.c,v 1.10 2005/02/17 17:29:58 xtraeme Exp $"); +__RCSID("$NetBSD: yacc.c,v 1.11 2006/04/05 20:03:14 dsl Exp $"); #endif #endif /* not lint */ @@ -106,6 +106,8 @@ y_entries(void) *sp++ = c; *sp = EOS; getline(); /* may change before ':' */ + if (c == EOF) + return; while (iswhite(c)) { if (c == '\n') SETLINE;