This is the mail archive of the
cygwin-xfree
mailing list for the Cygwin XFree86 project.
Re: "cscope -d" can't find trailer offset if path contains space (was: vim mlcscope interface issues)
- From: "Schwarz, Konrad" <konrad dot schwarz at siemens dot com>
- To: "cygwin-xfree at cygwin dot com" <cygwin-xfree at cygwin dot com>
- Date: Tue, 17 Apr 2012 09:55:12 +0200
- Subject: Re: "cscope -d" can't find trailer offset if path contains space (was: vim mlcscope interface issues)
- Reply-to: cygwin-xfree at cygwin dot com
Hello,
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.
Regards,
Konrad Schwarz
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
Documentation: http://x.cygwin.com/docs/
FAQ: http://x.cygwin.com/docs/faq/