You’re right to be confused because I made a mistake !
Here is what (I believe) is the real problem !
In openTagFile(), the default value of TagFile.name does not contain PATH_SEPARATOR.
Therefore absoluteDirname() never calls absoluteFilename() and the drive letter in TagFile.directory is not forced to uppercase.
Furthermore, when invoking ctags from a shell, the drive letter in TagFile.directory (CurrentDirectory) happens to be uppercase so the bug is invisible.
But for some reason, when invoking ctags from emacs directly (with M-x shell-command), then the driver letter in TagFile.directory happens to be lowercase and the bug shows up.
This eventually causes relativeFilename to fail to identify the common part in the paths, etc, etc…
Darren Hiebert [mailto:Darren@DarrenHiebert.com]
Sent: 19 July 2012 14:59
To: David Chappaz
Cc: 'Ctags Users'
Subject: Re: [Ctags] Ctags generates absolute instead of relative paths
I have to thank you for spelunking into the code like this. However, I am confused by your analysis. If I understood your example correctly, emacs was invoking ctags from two different contexts, one from a shell started from emacs, and another from emacs directly. However, in both cases, ctags would have been started without any file name argument, leaving it generate its own list from the -R option. Your analysis does not indicate why ctags would behave differently under the two cases unless the drive letter was sometimes generated in one case and sometimes in another.
Are you suggesting that etags is invoking ctags with an argument in one case?
Also, absoluteDirname() calls absoluteFilename() to do it’s dirty work, so it doesn’t appear possible for one to generate a drive letter in different case than the other.
On Jul 19, 2012, at 8:04 AM, David Chappaz wrote: