/[global]/global/libutil/gtagsop.c
ViewVC logotype

Diff of /global/libutil/gtagsop.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.48 by shigio, Sun Oct 31 04:16:00 2004 UTC revision 1.49 by shigio, Sun Oct 31 07:07:03 2004 UTC
# Line 503  gtags_add(gtop, comline, path, flags) Line 503  gtags_add(gtop, comline, path, flags)
503          if (!(ip = popen(strbuf_value(sb), "r")))          if (!(ip = popen(strbuf_value(sb), "r")))
504                  die("cannot execute '%s'.", strbuf_value(sb));                  die("cannot execute '%s'.", strbuf_value(sb));
505          while ((ctags_x = strbuf_fgets(ib, ip, STRBUF_NOCRLF)) != NULL) {          while ((ctags_x = strbuf_fgets(ib, ip, STRBUF_NOCRLF)) != NULL) {
506                  char    *tag, *p;                  char tag[MAXTOKEN], *p;
507    
508                  strbuf_trim(ib);                  strbuf_trim(ib);
509  #ifdef DEBUG  #ifdef DEBUG
510                  if (flags & GTAGS_DEBUG)                  if (flags & GTAGS_DEBUG)
511                          formatcheck(ctags_x, gtop->format);                          formatcheck(ctags_x, gtop->format);
512  #endif  #endif
513                  tag = strmake(ctags_x, " \t");           /* tag = $1 */                  /* tag = $1 */
514                    strlimcpy(tag, strmake(ctags_x, " \t"), sizeof(tag));
515                  /*                  /*
516                   * extract method when class method definition.                   * extract method when class method definition.
517                   *                   *
# Line 519  gtags_add(gtop, comline, path, flags) Line 520  gtags_add(gtop, comline, path, flags)
520                   * key  = 'method'                   * key  = 'method'
521                   * data = 'Class::method  103 ./class.cpp ...'                   * data = 'Class::method  103 ./class.cpp ...'
522                   */                   */
523                    p = tag;
524                  if (flags & GTAGS_EXTRACTMETHOD) {                  if (flags & GTAGS_EXTRACTMETHOD) {
525                          if ((p = locatestring(tag, ".", MATCH_LAST)) != NULL)                          if ((p = locatestring(tag, ".", MATCH_LAST)) != NULL)
526                                  tag = p + 1;                                  p++;
527                          else if ((p = locatestring(tag, "::", MATCH_LAST)) != NULL)                          else if ((p = locatestring(tag, "::", MATCH_LAST)) != NULL)
528                                  tag = p + 2;                                  p += 2;
529                  }                  }
530                  gtags_put(gtop, tag, ctags_x, fid);                  gtags_put(gtop, p, ctags_x, fid);
531          }          }
532          if (pclose(ip) < 0)          if (pclose(ip) < 0)
533                  die("terminated abnormally.");                  die("terminated abnormally.");

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.49

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26