| ... | ... | @@ -1910,15 +1910,6 @@ pub fn execvpeZ( |
| 1910 | 1910 | /// See also `getenvZ`. |
| 1911 | 1911 | pub fn getenv(key: []const u8) ?[:0]const u8 { |
| 1912 | 1912 | if (builtin.link_libc) { |
| 1913 | | // Append null byte to the key to use with cstd getenv |
| 1914 | | var small_key_buf: [64]u8 = undefined; |
| 1915 | | if (key.len < small_key_buf.len) { |
| 1916 | | @memcpy(small_key_buf[0..key.len], key); |
| 1917 | | small_key_buf[key.len] = 0; |
| 1918 | | return getenvZ(small_key_buf[0..key.len :0]); |
| 1919 | | } |
| 1920 | | |
| 1921 | | // Search the entire `environ` because we don't have a null terminated pointer. |
| 1922 | 1913 | var ptr = std.c.environ; |
| 1923 | 1914 | while (ptr[0]) |line| : (ptr += 1) { |
| 1924 | 1915 | var line_i: usize = 0; |