aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/ctags
diff options
context:
space:
mode:
authorSteve Price <steve@FreeBSD.org>1997-08-23 16:13:45 +0000
committerSteve Price <steve@FreeBSD.org>1997-08-23 16:13:45 +0000
commit0c30eecaa020a355dde54f0b086df25d550a2026 (patch)
treedcd4292d3bb687c9624d286506a16f2a77ebb66f /usr.bin/ctags
parentcf90bd0cbb7683c5821c8d8e9b8a52ab80dd4be3 (diff)
downloadsrc-0c30eecaa020a355dde54f0b086df25d550a2026.tar.gz
src-0c30eecaa020a355dde54f0b086df25d550a2026.zip
Teach ctags(1) how to handle intermediate whitespace in macros
and function definitions. PR: misc/4128 Submitted by: Shigio Yamaguchi <shigio@wafu.netgate.net>
Notes
Notes: svn path=/head/; revision=28625
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 de83f7856cd3..c030cedb2640 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))