diff options
Diffstat (limited to 'sys/kern/kern_environment.c')
| -rw-r--r-- | sys/kern/kern_environment.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c index 8c4d7dcfbc3b..a5c5e087d460 100644 --- a/sys/kern/kern_environment.c +++ b/sys/kern/kern_environment.c @@ -238,10 +238,11 @@ _getenv_static(const char *name) for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { for (ep = cp; (*ep != '=') && (*ep != 0); ep++) ; + if (*ep != '=') + continue; len = ep - cp; - if (*ep == '=') - ep++; - if (!strncmp(name, cp, len)) + ep++; + if (!strncmp(name, cp, len) && name[len] == 0) return (ep); } return (NULL); |
