| ... | @@ -1726,6 +1726,12 @@ pub fn getenvW(key: [*:0]const u16) ?[:0]const u16 { | ... | @@ -1726,6 +1726,12 @@ pub fn getenvW(key: [*:0]const u16) ?[:0]const u16 { |
| 1726 | while (ptr[i] != 0) { | 1726 | while (ptr[i] != 0) { |
| 1727 | const key_start = i; | 1727 | const key_start = i; |
| 1728 | | 1728 | |
| | 1729 | // There are some special environment variables that start with =, |
| | 1730 | // so we need a special case to not treat = as a key/value separator |
| | 1731 | // if it's the first character. |
| | 1732 | // https://devblogs.microsoft.com/oldnewthing/20100506-00/?p=14133 |
| | 1733 | if (ptr[key_start] == '=') i += 1; |
| | 1734 | |
| 1729 | while (ptr[i] != 0 and ptr[i] != '=') : (i += 1) {} | 1735 | while (ptr[i] != 0 and ptr[i] != '=') : (i += 1) {} |
| 1730 | const this_key = ptr[key_start..i]; | 1736 | const this_key = ptr[key_start..i]; |
| 1731 | | 1737 | |