Re: Patches for windows paths
Shigio YAMAGUCHI <[email protected]> Wed, 18 Mar 2026 16:48:08 +0900
| Newsgroups | gmane.comp.gnu.global.bugs |
|---|---|
| Message-ID | <CADJmJYqD73+2nAFR8E5015KuWqD+Q9LTTY1JDybhuGrY+KoqmA@mail.gmail.com> |
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); <=3D=3D=3D
135 back2slash_str(path); <=3D=3D=3D
[global/global.c]
954 putenv("GTAGSLIBPATH=3D"); <=3D=3D=3D
Thank you for the patch!
On Wed, Mar 18, 2026 at 12:59=E2=80=AFAM pascal.jaeger leimstift.de
<[email protected]> wrote:
>
> Hi,
>
> having to use GNU Global on windows on my work computer and I noticed tha=
t GTAGSOBJDIRPREFIX does not work for windows.
> I examined the code and noticed the creation of the folders in GTAGSOBJDI=
RPREFIX 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 c=
oncatenate 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/pro=
ject, 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 th=
is 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
--=20
Shigio YAMAGUCHI <[email protected]>
PGP fingerprint:
26F6 31B4 3D62 4A92 7E6F 1C33 969C 3BE3 89DD A6EB