mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
os_getenvname_at_index: Handle Windows env vars whose name starts with =
This commit is contained in:
parent
6dc1005787
commit
39963c6a04
@ -302,7 +302,10 @@ char *os_getenvname_at_index(size_t index)
|
||||
break;
|
||||
}
|
||||
|
||||
const char * const end = strchr(utf8_str, '=');
|
||||
// Some Windows env vars start with =, so skip over that to find the
|
||||
// separator between name/value
|
||||
const char * const end = strchr(utf8_str + (utf8_str[0] == '=' ? 1 : 0),
|
||||
'=');
|
||||
assert(end != NULL);
|
||||
ptrdiff_t len = end - utf8_str;
|
||||
assert(len > 0);
|
||||
|
Loading…
Reference in New Issue
Block a user