bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] gtags-cscope -C (ignore case) can't find definitions


From: Steven Mueller
Subject: [PATCH] gtags-cscope -C (ignore case) can't find definitions
Date: Thu, 1 Apr 2010 03:37:43 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

Hi,

When using gtags-cscope with the -C argument to ignore case, it passes
malformed arguments to global which prevents it from looking up the
definition points of the requested identifier.

Given bug.c:
------------
#define FOO 12
int main(int argc, const char *argv[]) {
    return FOO;
}

Repro:
------
$ gtags-cscope -Cv

Expected:
---------
>> 1foo
gscope: /usr/local/bin/global --result=cscope --ignore-case 'foo'
cscope: 1 lines
bug.c FOO 1 #define FOO 12

We get:
-------
>> 1foo
gscope: /usr/local/bin/global --result=cscope -
cscope: 0 lines


The problem is in execute_command() -- when the opt argument is 0 it
adds a bad "-\0" commandline option to the command strbuf which
null-terminates it.  The attached patch corrects and simplifies this
logic.

It looks like I just missed a release with this; sorry!  Please consider
the patch for the next release.

Thanks,
Steve

-- 
Steven Mueller

Attachment: gtags-cscope-C-fix.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]