#78 Tag not found

release
closed-accepted
Alexander Mai
Program (402)
6
2001-10-19
2001-10-01
No

Tags are not found if the referenced tag contains a
semicolon ";". This seems to be the reason for the
problems with certain tag constellations reported on
the NEdit developers mailing list recently.

The patch appended should fix this. It does the
following:

- scan for the last instead of the first semicolon
termintation of the tag search expression

- support for standard ctags expressions containing
semicolon characters

- better distinction between exuberant ctags formats 1
(=standard ctags) and 2 (standard exuberant ctags)

- translate the search expression into a NEdit
compatible RE and search
the tag using regex search (On search time, not on load
time).

- fixed a missing XtFree() call

Discussion

  • patch against current cvs

     
    Attachments
  • Alexander Mai
    Alexander Mai
    2001-10-01

    Logged In: YES
    user_id=15180

    Does "current cvs" mean main trunk?
    I think people have agreed anyway not to fix this for 5.2?!

     
  • Logged In: YES
    user_id=81393

    Sorry, yes, "current cvs"
    means main trunk.

    The patch is intended for the after 5.2 versions (altough I
    suppose it would work for 5.2, too). It should be tested by
    people who heavily use tags. (The
    first tries with tags generated for the NEdit sources worked
    well).

     
  • Logged In: YES
    user_id=81393

    The patch by now didn't fix another problem: (simplified:)
    tags from the same source file were found only once. This
    appeared in Revision 1.19, where the lines:

    /* BUG? tagPath is shared between tags. I don't think it
    gets deallocated when the file is unloaded */
    ParseFilename(filename, unused, tmpPath);
    tagPath = (char *)malloc(strlen(tmpPath)+1);
    strcpy(tagPath, tmpPath);

    in loadTagsFile had been replaced by
    ParseFilename(filename, unused, tagPath);

    This didn't work because tag->path was not duplicated int
    addTag().
    Now this is added together with the proper rcs_free in
    delTag()

     
  • Logged In: YES
    user_id=81393

    The patch by now didn't fix another problem: (simplified:)
    tags from the same source file were found only once. This
    appeared in Revision 1.19, where the lines:

    /* BUG? tagPath is shared between tags. I don't think it
    gets deallocated when the file is unloaded */
    ParseFilename(filename, unused, tmpPath);
    tagPath = (char *)malloc(strlen(tmpPath)+1);
    strcpy(tagPath, tmpPath);

    in loadTagsFile had been replaced by
    ParseFilename(filename, unused, tagPath);

    This didn't work because tag->path was not duplicated int
    addTag().
    Now this is added together with the proper rcs_free in
    delTag()

     
  • Alexander Mai
    Alexander Mai
    2001-10-04

    Logged In: YES
    user_id=15180

    The second patch has been appplied to the main trunk.
    Please create -c/-u diffs in future. Their additional
    redundancy is helpful ...

     
  • Alexander Mai
    Alexander Mai
    2001-10-04

    • assigned_to: nobody --> amai
     
  • Scott Tringali
    Scott Tringali
    2001-10-08

    Logged In: YES
    user_id=11321

    I think this a fairly old problem... set to "release". Fix
    in 5.2+

     
  • Scott Tringali
    Scott Tringali
    2001-10-08

    • milestone: --> release
     
  • patch (context diff) against cvs main trunk for tags.c, rev. 1.20

     
    Attachments
  • Logged In: YES
    user_id=81393

    Here is another patch against cvs, main trunk, for tags.c
    rev 1.20 (where my changes from tags-semicolon2.diff are
    contained) which fixes the tag search expression for the
    following cases:
    - remove backslash escapes from slashes (added by both ctags
    and exuberant ctags)
    - remove literal CR characters added by standard ctags just
    before line end for DOSified source files

    (Both special cases will have lead to not finding the tag
    for pre 1.20 revisions of tags.c, too)

     
  • Alexander Mai
    Alexander Mai
    2001-10-15

    Logged In: YES
    user_id=15180

    Ok, applied.

     
  • Alexander Mai
    Alexander Mai
    2001-10-15

    • priority: 5 --> 6
    • status: open --> open-accepted
     
  • Alexander Mai
    Alexander Mai
    2001-10-19

    • labels: --> Program
    • status: open-accepted --> closed-accepted
     
  • Alexander Mai
    Alexander Mai
    2001-10-19

    Logged In: YES
    user_id=15180

    Will fade away now ...