Hello,
Since I can't test it on Windows, I'd like to wait about a week
for everyone's feedback before adding it to the repository.

Also, please allow me to add #ifdefs to the following code
so that it only works on Windows, as it is difficult to confirm
that no problems will occur.

[libutil/getdbpath.c]
133             setupvariables(verbose);                <===

135     back2slash_str(path);                           <===

[global/global.c]

954                     putenv("GTAGSLIBPATH=");        <===

Thank you for the patch!

On Wed, Mar 18, 2026 at 12:59 AM pascal.jaeger leimstift.de
<[email protected]> wrote:
>
> Hi,
>
> having to use GNU Global on windows on my work computer and I noticed that 
> GTAGSOBJDIRPREFIX does not work for windows.
> I examined the code and noticed the creation of the folders in 
> GTAGSOBJDIRPREFIX is just skipped by an #ifdef if global is compiled for 
> windows.
> Thinking about this it is quite obvious why. Windows paths are awful to 
> concatenate and you cannot do something simple. If you have something like 
> C:\some\path as the GTAGSOBJDIRPREFIX and want to create GTAGS for 
> C:/my/project, you would end up with C:\\some\\path/C:/my/project/ as objdir.
> Well but you can solve this by getting rid of the second : and just have 
> C:\\some\\path/C/my/project/. (yes, apparently windows can work with that \\ 
> / mess) Getting rid of the whole drive letter isn't a good idea I think, 
> because you could have 2 projects in C:/my/project and D:/my/project and this 
> could end up messy.
>
> I patched this functionality in. It also normalizes the windows paths to use 
> only /.
> The patch is attached. Let me know if you want me to change anything for it.
> If you want to merge it into core, I will sign that copyright letter and send 
> it to you.
>
> Best regards



-- 
Shigio YAMAGUCHI <[email protected]>
PGP fingerprint:
26F6 31B4 3D62 4A92 7E6F  1C33 969C 3BE3 89DD A6EB

Reply via email to