Raghavendra D Prabhu wrote:
> >> Currently when using cscope with vim and being several levels deep from
> >> project root directory (with cscope.out located in this directory), the
> >> cscope queries fail because of lack of prefix. Using a cscope prefix on
> >> a per-project basis is hard. So, this patch introduces a boolean
> >> variable setting which vim will be able use (in the absence of an
> >> already existing prefix path) the prefix of cscope.out to canonicalize
> >> the path obtained from 'cs find'. I have also tested it and it works
> >> fine.
> >
> >Isn't this similar to what 'tagrelative' does to file names in tags
> >files? Then perhaps we should use a similar name: 'cscoperelative'?
>
> Yeah, 'cscoperelative' name makes more sense and it will be easier for
> people to find it too. I have attached patch with the name change.
A few remarks about the patch. Please fix this and send a new patch.
The strdup() calls are leaking memory. You can't use dirname(), it's
not on all systems.
I don't think it works when the directory name is empty, it would result
in a leading slash.
You can use gettail(). You probably want to compute the size of the
directory name and concate the name when it's not zero. Search for
"p_tr" in src/tag.c for an example. The use of vim_isAbsName() might
also apply.
Please use coding style as in the rest of the Vim sources.
The documentation in if_cscop.txt isn't very clear. Please mention what
happens to a path that cscope returns. I don't know what "prefix path"
means. Either explain that or use some other wording.
--
>From "know your smileys":
% Bike accident. A bit far-fetched, I suppose; although...
o _ _ _
_o /\_ _ \\o (_)\__/o (_)
_< \_ _>(_) (_)/<_ \_| \ _|/' \/
(_)>(_) (_) (_) (_) (_)' _\o_
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php