"cscope -d" can't find trailer offset if path contains space (was: vim mlcscope interface issues)
Tue Apr 17 07:55:00 GMT 2012
an easy work around for the problem that cscope and its variant mlcscope
cannot deal with paths containing spaces under Cygwin is to replace such paths
with their DOS short name equivalents, since these do not contain spaces.
The error surfaces as the error message
mlcscope: cannot read trailer offset from file ./cscope.out
and in that mlcscope recreates the program database each time it is started.
When starting cscope using relative paths (the most frequent case), eliminating
spaces must be done for the current working directory.
The cygpath utility comes in handy for this. E.g., invoking mlcscope as
(cd $(cygpath -u $(cygpath -d "$PWD"));mlcscope -b)
solves the problem.
In the above line, the inner call to cygpath converts the working directory
to DOS format, the outer call converts the result to Cygwin format; preserving
the short names of DOS, but replacing backslashes with forward slashes, for example.
Unfortunately, it is not possible to combine the -u and -d flags in a single
invocation of cygpath; this would be a useful extension.
P.S.: Sorry for resurrecting an old thread from Jan 2007. However, this thread
seems to be the only place the problem was discussed.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
More information about the Cygwin-xfree