Re: g_getenv() encoding on Windows



On 31/12/04 18:08:55, Tor Lillqvist wrote:
BTW, what do you think about the ExpandEnvironmentStrings() that
g_getenv() does? Is it actually necessary or not? I don't remember
the details of the case when I noticed environment variables with
references to other environment variables in them. It was a long time
ago, at work, on some NT 4 machines. It might well be that it was the
result of some broken local installation scripts or something, and
not anything common at all.

On the other hand, removing it might break something for somebody who
actually depends on this functionality.

I don't know. My hunch would be that g_getenv() shouldn't do the expansion if we were designing the API from scratch. It would be better if the registry was fixed or if glib provided a g_getenv_expanded() or something, but I don't think it's worth breaking the API over. If we ever come across a usage case for providing the unexpanded strings we can always consider adding a g_getenv_unexpanded() or something, but I can't really see where that could be useful.

Cheers,

Ali.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]