From owner-freebsd-bugs Sun Jul 20 09:00:04 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id JAA21478 for bugs-outgoing; Sun, 20 Jul 1997 09:00:04 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id JAA21472; Sun, 20 Jul 1997 09:00:02 -0700 (PDT) Resent-Date: Sun, 20 Jul 1997 09:00:02 -0700 (PDT) Resent-Message-Id: <199707201600.JAA21472@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, shigio@wafu.netgate.net Received: from wafu.netgate.net (wafu.netgate.net [204.145.147.80]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id IAA21246 for ; Sun, 20 Jul 1997 08:52:52 -0700 (PDT) Received: from chiota.signet.or.jp (INS91.tama.dti.ne.jp [210.159.144.45]) by wafu.netgate.net (8.7.5/8.7.3) with ESMTP id HAA23547 for ; Sun, 20 Jul 1997 07:46:47 GMT Received: (from shigio@localhost) by chiota.signet.or.jp (8.8.5/) id AAA05496; Mon, 21 Jul 1997 00:53:36 +0900 (JST) Message-Id: <199707200746.HAA23547@wafu.netgate.net> Date: Mon, 21 Jul 1997 00:53:36 +0900 (JST) From: shigio@wafu.netgate.net Reply-To: shigio@wafu.netgate.net To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: misc/4128: ctags(1) is decived by extra blanks. Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4128 >Category: misc >Synopsis: ctags(1) overlooks objects decived by extra blanks. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jul 20 09:00:01 PDT 1997 >Last-Modified: >Originator: Shigio Yamaguchi >Organization: Freelance programmer >Release: FreeBSD 2.2.1-RELEASE i386 >Environment: All environments. >Description: Ctags(1) overlooks some functions and macros decived by extra blanks. 1. function Blanks which follows function name disturbs ctags. func () {} ^ 2. macro Blanks which follows '#' disturbs ctags. # define macro() ; ^ >How-To-Repeat: test.c ------------------------------------------ # define macro() printf("Hello") func () { print("Hello"); } ------------------------------------------ % ctags -x test.c % It should be like this. func 2 test.c func () macro 1 test.c # define macro() printf("Hello") >Fix: [/usr/src/usr.bin/ctags/C.c] *** C.c.orig Mon Jul 21 00:23:04 1997 --- C.c Mon Jul 21 00:24:24 1997 *************** *** 193,198 **** --- 193,213 ---- * reserved words. */ default: + /* + * to treat following function. + * func (arg) { + * .... + * } + */ + if (c == ' ' || c == '\t') { + int save = c; + while (GETC(!=, EOF) && (c == ' ' || c == '\t')) + ; + if (c == EOF) + return; + (void)ungetc(c, inf); + c = save; + } storec: if (!intoken(c)) { if (sp == tok) break; *************** *** 310,315 **** --- 325,338 ---- int curline; /* line started on */ char *sp; /* buffer pointer */ char tok[MAXTOKEN]; /* storage buffer */ + + /* + * to treat following macro. + * # macro(arg) .... + */ + while (GETC(!=, EOF) && (c == ' ' || c == '\t')) + ; + (void)ungetc(c, inf); curline = lineno; for (sp = tok;;) { /* get next token */ >Audit-Trail: >Unformatted: