Commit 0d6d673
committed
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 <[email protected]>1 parent e678595 commit 0d6d673
1 file changed
+19
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2220 | 2220 | | |
2221 | 2221 | | |
2222 | 2222 | | |
| 2223 | + | |
| 2224 | + | |
2223 | 2225 | | |
2224 | 2226 | | |
2225 | | - | |
2226 | | - | |
| 2227 | + | |
2227 | 2228 | | |
2228 | 2229 | | |
2229 | 2230 | | |
2230 | 2231 | | |
2231 | 2232 | | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
2232 | 2248 | | |
2233 | 2249 | | |
2234 | 2250 | | |
| |||
2303 | 2319 | | |
2304 | 2320 | | |
2305 | 2321 | | |
2306 | | - | |
| 2322 | + | |
2307 | 2323 | | |
2308 | | - | |
2309 | | - | |
2310 | | - | |
2311 | | - | |
2312 | | - | |
2313 | | - | |
2314 | | - | |
2315 | | - | |
2316 | | - | |
2317 | | - | |
2318 | | - | |
2319 | | - | |
2320 | | - | |
2321 | | - | |
2322 | | - | |
2323 | | - | |
2324 | | - | |
2325 | | - | |
2326 | 2324 | | |
2327 | 2325 | | |
2328 | 2326 | | |
| |||
0 commit comments