Fixed bug in checking of last char of environment variable
This commit is contained in:
parent
e8ff85905f
commit
e001541608
1 changed files with 2 additions and 2 deletions
|
@ -18,8 +18,8 @@ getenv(const char *name)
|
||||||
return (char *)NULL;
|
return (char *)NULL;
|
||||||
while ((p = *v++) != NULL) {
|
while ((p = *v++) != NULL) {
|
||||||
q = name;
|
q = name;
|
||||||
while (*q && (*q++ == *p++))
|
while (*q && (*q == *p++))
|
||||||
/* EMPTY */ ;
|
q++;
|
||||||
if (*q || (*p != '='))
|
if (*q || (*p != '='))
|
||||||
continue;
|
continue;
|
||||||
return (char *)p + 1;
|
return (char *)p + 1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue