Permalink
Browse files

Don't emit empty tags

  • Loading branch information...
1 parent 1cbcf71 commit dbb9971b7190031af38c30207851670b1bb08080 @nickg committed Mar 7, 2011
Showing with 7 additions and 4 deletions.
  1. +7 −4 clang-tags.c
View
@@ -116,10 +116,13 @@ static enum CXChildVisitResult cursor_visitor(CXCursor cursor,
CXString file_str = clang_getFileName(file);
CXString str = clang_getCursorSpelling(cursor);
- printf("visit: %s: line %u col %u off %u: %s\n",
- clang_getCString(file_str), line, column, offset,
- clang_getCString(str));
- emit_tag(clang_getCString(str), search, line, offset);
+
+ if (clang_getCString(str)[0] != '\0') {
+ printf("visit: %s: line %u col %u off %u: %s\n",
+ clang_getCString(file_str), line, column, offset,
+ clang_getCString(str));
+ emit_tag(clang_getCString(str), search, line, offset);
+ }
clang_disposeString(str);
clang_disposeString(file_str);

0 comments on commit dbb9971

Please sign in to comment.