#53 vim.c misses lower case <sid> tags

closed-fixed
None
5
2002-12-21
2002-12-21
Dave Vehrs
No

ctrags
Version 5.4.1
File: vim.c file

Problem: When scanning vim files for functions, those
declared with a <SID> tag are caught only if the tag is
in upper case. A lower case tag (<sid>) is also valid
syntax so it should be caught as well.

Quick fix, change line 59:

else if (strncmp (const char*) name, "<SID>",
(size_t) 5) == 0)

To
else if ((strncmp ((const char*) name, "<SID>",
(size_t) 5) == 0) ||
(strncmp ((const char*) name, "<sid>",
(size_t) 5) == 0))

or is there a way to make strncmp case insensitive?

Thanks

Dave Vehrs

Discussion

  • Darren Hiebert
    Darren Hiebert
    2002-12-21

    Logged In: YES
    user_id=38016

    Thanks for providing the fix. This problem will be fixed in
    the next release.

     
  • Darren Hiebert
    Darren Hiebert
    2002-12-21

    • assigned_to: nobody --> dhiebert
    • status: open --> closed-fixed
     
  • Darren Hiebert
    Darren Hiebert
    2002-12-21

    Patch to fix bug

     
    Attachments
  • Dave Vehrs
    Dave Vehrs
    2002-12-22

    Logged In: YES
    user_id=371080

    Sorry to do this but I found a better way to fix this.
    Instead of my earlier fix, just change line 59 from

    else if (strncmp (const char*) name, "<SID>",
    (size_t) 5) == 0)

    To:

    else if (strncasecmp (const char*) name, "<SID>",
    (size_t) 5) == 0)

    And all possible combinations of case will be caught.

    Thanks,

    Dave Vehrs