summaryrefslogtreecommitdiffstats
path: root/usr.bin/ctags
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1997-08-23 16:13:45 +0000
committersteve <steve@FreeBSD.org>1997-08-23 16:13:45 +0000
commit4686bb5ffb991f52b3888cbe47b43b5a504db4e0 (patch)
tree8313839f68a45d168de3155c6011d73ab97e9541 /usr.bin/ctags
parent2795165c699b47efd320277ffc00d4cfaa79ccb9 (diff)
downloadFreeBSD-src-4686bb5ffb991f52b3888cbe47b43b5a504db4e0.zip
FreeBSD-src-4686bb5ffb991f52b3888cbe47b43b5a504db4e0.tar.gz
Teach ctags(1) how to handle intermediate whitespace in macros
and function definitions. PR: misc/4128 Submitted by: Shigio Yamaguchi <shigio@wafu.netgate.net>
Diffstat (limited to 'usr.bin/ctags')
-rw-r--r--usr.bin/ctags/C.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/usr.bin/ctags/C.c b/usr.bin/ctags/C.c
index de83f78..c030ced 100644
--- a/usr.bin/ctags/C.c
+++ b/usr.bin/ctags/C.c
@@ -32,7 +32,12 @@
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)C.c 8.4 (Berkeley) 4/2/94";
+#else
+static const char rcsid[] =
+ "$Id$";
+#endif
#endif /* not lint */
#include <limits.h>
@@ -193,6 +198,16 @@ c_entries()
* reserved words.
*/
default:
+ /* ignore whitespace */
+ 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;
@@ -311,6 +326,11 @@ hash_entry()
char *sp; /* buffer pointer */
char tok[MAXTOKEN]; /* storage buffer */
+ /* ignore leading whitespace */
+ while (GETC(!=, EOF) && (c == ' ' || c == '\t'))
+ ;
+ (void)ungetc(c, inf);
+
curline = lineno;
for (sp = tok;;) { /* get next token */
if (GETC(==, EOF))
OpenPOWER on IntegriCloud