=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ctags/C.c,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** src/usr.bin/ctags/C.c 1997/07/21 23:18:45 1.4 --- src/usr.bin/ctags/C.c 2000/07/25 19:28:30 1.5 *************** *** 1,4 **** ! /* $OpenBSD: C.c,v 1.4 1997/07/21 23:18:45 deraadt Exp $ */ /* $NetBSD: C.c,v 1.3 1995/03/26 20:14:02 glass Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: C.c,v 1.5 2000/07/25 19:28:30 deraadt Exp $ */ /* $NetBSD: C.c,v 1.3 1995/03/26 20:14:02 glass Exp $ */ /* *************** *** 38,44 **** #if 0 static char sccsid[] = "@(#)C.c 8.4 (Berkeley) 4/2/94"; #else ! static char rcsid[] = "$OpenBSD: C.c,v 1.4 1997/07/21 23:18:45 deraadt Exp $"; #endif #endif /* not lint */ --- 38,44 ---- #if 0 static char sccsid[] = "@(#)C.c 8.4 (Berkeley) 4/2/94"; #else ! static char rcsid[] = "$OpenBSD: C.c,v 1.5 2000/07/25 19:28:30 deraadt Exp $"; #endif #endif /* not lint */ *************** *** 101,107 **** * the above 3 cases are similar in that they * are special characters that also end tokens. */ ! endtok: if (sp > tok) { *sp = EOS; token = YES; sp = tok; --- 101,107 ---- * the above 3 cases are similar in that they * are special characters that also end tokens. */ ! endtok: if (sp > tok) { *sp = EOS; token = YES; sp = tok; *************** *** 246,252 **** sp = tok; } else if (sp != tok || begtoken(c)) { ! *sp++ = c; token = YES; } continue; --- 246,258 ---- sp = tok; } else if (sp != tok || begtoken(c)) { ! if (sp >= tok + sizeof tok) { ! /* hell... truncate it */ ! if (sp == tok + sizeof(tok)) ! *sp = '\0'; ! sp++; ! } else ! *sp++ = c; token = YES; } continue; *************** *** 347,353 **** return; if (iswhite(c)) break; ! *sp++ = c; } *sp = EOS; if (memcmp(tok, "define", 6)) /* only interested in #define's */ --- 353,365 ---- return; if (iswhite(c)) break; ! if (sp >= tok + sizeof(tok)) { ! /* hell... truncate it */ ! if (sp == tok + sizeof(tok)) ! *sp = '\0'; ! sp++; ! } else ! *sp++ = c; } *sp = EOS; if (memcmp(tok, "define", 6)) /* only interested in #define's */ *************** *** 359,365 **** break; } for (sp = tok;;) { /* get next token */ ! *sp++ = c; if (GETC(==, EOF)) return; /* --- 371,383 ---- break; } for (sp = tok;;) { /* get next token */ ! if (sp >= tok + sizeof tok) { ! /* hell... truncate it */ ! if (sp == tok + sizeof(tok)) ! *sp = '\0'; ! sp++; ! } else ! *sp++ = c; if (GETC(==, EOF)) return; /* *************** *** 401,407 **** if (c == '{') /* it was "struct {" */ return (YES); for (sp = tok;;) { /* get next token */ ! *sp++ = c; if (GETC(==, EOF)) return (NO); if (!intoken(c)) --- 419,431 ---- if (c == '{') /* it was "struct {" */ return (YES); for (sp = tok;;) { /* get next token */ ! if (sp >= tok + sizeof tok) { ! /* hell... truncate it */ ! if (sp == tok + sizeof(tok)) ! *sp = '\0'; ! sp++; ! } else ! *sp++ = c; if (GETC(==, EOF)) return (NO); if (!intoken(c))