summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdlib/getenv_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdlib/getenv_r.c')
-rw-r--r--newlib/libc/stdlib/getenv_r.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/newlib/libc/stdlib/getenv_r.c b/newlib/libc/stdlib/getenv_r.c
index 85d250b79..bfa9682f2 100644
--- a/newlib/libc/stdlib/getenv_r.c
+++ b/newlib/libc/stdlib/getenv_r.c
@@ -74,7 +74,6 @@ static char ***p_environ = &environ;
* Returns pointer to value associated with name, if any, else NULL.
* Sets offset to be the offset of the name/value combination in the
* environmental array, for use by setenv(3) and unsetenv(3).
- * Explicitly removes '=' in argument name.
*
* This routine *should* be a static; don't use it.
*/
@@ -99,13 +98,8 @@ _DEFUN (_findenv_r, (reent_ptr, name, offset),
return NULL;
}
- c = name;
- len = 0;
- while (*c && *c != '=')
- {
- c++;
- len++;
- }
+ len = strlen(name);
+ c = name + len;
for (p = *p_environ; *p; ++p)
if (!strncmp (*p, name, len))