Commit f1e0a8e
mingw: move MSys2 specific environment tweaks to setup_windows_environment
Lets keep the environment initialization and conversion section as lean as
possible and move recently added tweaks to setup_windows_environment().
This fixes the following potential problems:
* Prevent duplicate TZ variables if both TZ and MSYS2_TZ are set.
* Some of the higher level x* APIs from wrapper.c require a working
getenv(), using e.g. xstrdup() during initialization is dangerous.
* Slashifying the Windows TMP variable may break native Windows programs,
use POSIX TMPDIR instead.
* Properly slashify TMPDIR even if it is already set, and also if we only
have TEMP, but not TMP.
* Reduce complexity from O(n) to O(log n).
Signed-off-by: Karsten Blees <blees@dcon.de>1 parent e20cade commit f1e0a8e
1 file changed
+19
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2211 | 2211 | | |
2212 | 2212 | | |
2213 | 2213 | | |
| 2214 | + | |
| 2215 | + | |
2214 | 2216 | | |
2215 | 2217 | | |
2216 | | - | |
2217 | | - | |
| 2218 | + | |
2218 | 2219 | | |
2219 | 2220 | | |
2220 | 2221 | | |
2221 | 2222 | | |
2222 | 2223 | | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
2223 | 2239 | | |
2224 | 2240 | | |
2225 | 2241 | | |
| |||
2294 | 2310 | | |
2295 | 2311 | | |
2296 | 2312 | | |
2297 | | - | |
| 2313 | + | |
2298 | 2314 | | |
2299 | | - | |
2300 | | - | |
2301 | | - | |
2302 | | - | |
2303 | | - | |
2304 | | - | |
2305 | | - | |
2306 | | - | |
2307 | | - | |
2308 | | - | |
2309 | | - | |
2310 | | - | |
2311 | | - | |
2312 | | - | |
2313 | | - | |
2314 | | - | |
2315 | | - | |
2316 | | - | |
2317 | 2315 | | |
2318 | 2316 | | |
2319 | 2317 | | |
| |||
0 commit comments