Hi,
> Not sure I understood your approach though, but if it’s better than I am
all
> for using it instead of mine.

I don't understand the approach either, but since Jason always releases
Windows versions of Global, I'd like to follow his patch. Actually, I don't
have a Windows machine, so I can't test it.

Thank you both!

On Fri, Mar 20, 2026 at 1:25 AM Pascal Jaeger <[email protected]>
wrote:

> Hi,
>
> I don’t think it’s necessary to put the setupvariables(verbose) behind an
> ifdef. It only changes what is printed out when calling the function. I
> think that is easy enough to reason about. I don’t know why it was called
> with 0 on Linux in the first place. I thought it was a mistake.
>
> The back2slash_str macro resolves to nothing on non windows systems
> anyway, so no need to put it behind another ifdef either.
>
> Regarding unsetenv the situation is a bit complicated. Apparently msvcrt
> and ucrt don’t have it, but older msys-2.0 does. MS says to use putenv with
> an empty variable to unset an environment variable.
> „ You can remove a variable from the environment by specifying an empty
> *value_string*, or in other words, by specifying only *varname*=.
> [1][2]
>
> FWIW GNU knows unsetenv is missing on mingw and msvc. [3]
>
> You’re right, in order not to risk breaking things, this should be behind
> an ifdef and we should use unsetenv on linux as before.
>
> Not sure I understood your approach though, but if it’s better than I am
> all for using it instead of mine.
>
> Regards
> Pascal
>
>
> [1]
>  
> https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/putenv?view=msvc-170
> <https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/putenv?view=msvc-170>
> [2]
>  
> https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/putenv-wputenv?view=msvc-170
> <https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/putenv-wputenv?view=msvc-170>
> [3] https://www.gnu.org/software/gnulib/manual/html_node/unsetenv.html
>
> --
> Sent from Canary <https://canarymail.io>
>
> On Donnerstag, März 19, 2026 at 09:10, Jason Hood <[email protected]>
> wrote:
> On 18/03/2026 17:48, Shigio YAMAGUCHI wrote:
>
> [libutil/getdbpath.c]
> 133 setupvariables(verbose); <===
>
>
> Why is this not already present? gtagsexist has it, why not this?
> Even so, it ends up being ignored in global, since it gets called
> with 0 (before options are processed).
>
> [global/global.c]
>
> 954 putenv("GTAGSLIBPATH="); <===
>
>
> Not sure why that's necessary, my old MinGW has unsetenv.
>
> having to use GNU Global on windows on my work computer and I noticed that
> GTAGSOBJDIRPREFIX does not work for windows.
>
> I took a slightly different approach, converting back2slash from
> global.c into a function in path.c (and moving STRCMP to path.h
> as PATHCMP). I duplicate the variables and convert them once (and
> use "c:/usr/obj" as default). Rather than stripping a colon I
> assume the drive is present and generate a new path without it
> (D:/path -> /D/path).
>
> --
> Jason.
>
>

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

Reply via email to