| ... | ... | @@ -1893,6 +1893,9 @@ pub fn execvpeZ( |
| 1893 | 1893 | /// Get an environment variable. |
| 1894 | 1894 | /// See also `getenvZ`. |
| 1895 | 1895 | pub fn getenv(key: []const u8) ?[:0]const u8 { |
| 1896 | if (builtin.os.tag == .windows) { |
| 1897 | @compileError("std.os.getenv is unavailable for Windows because environment strings are in WTF-16 format. See std.process.getEnvVarOwned for a cross-platform API or std.os.getenvW for a Windows-specific API."); |
| 1898 | } |
| 1896 | 1899 | if (builtin.link_libc) { |
| 1897 | 1900 | var ptr = std.c.environ; |
| 1898 | 1901 | while (ptr[0]) |line| : (ptr += 1) { |
| ... | ... | @@ -1906,9 +1909,7 @@ pub fn getenv(key: []const u8) ?[:0]const u8 { |
| 1906 | 1909 | } |
| 1907 | 1910 | return null; |
| 1908 | 1911 | } |
| 1909 | | if (builtin.os.tag == .windows) { |
| 1910 | | @compileError("std.os.getenv is unavailable for Windows because environment string is in WTF-16 format. See std.process.getEnvVarOwned for cross-platform API or std.os.getenvW for Windows-specific API."); |
| 1911 | | } else if (builtin.os.tag == .wasi) { |
| 1912 | if (builtin.os.tag == .wasi) { |
| 1912 | 1913 | @compileError("std.os.getenv is unavailable for WASI. See std.process.getEnvMap or std.process.getEnvVarOwned for a cross-platform API."); |
| 1913 | 1914 | } |
| 1914 | 1915 | // The simplified start logic doesn't populate environ. |