summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--src/libstddjb/env_merge.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/AUTHORS b/AUTHORS
index d89bd8f..424e58c 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -36,3 +36,4 @@ Thanks to:
Johannes Nixdorf <mixi@shadowice.org>
Casper Ti. Vector <caspervector@gmail.com>
Guillermo <gdiazhartusch@gmail.com>
+ Alex Raschi <raschi.alex@gmail.com>
diff --git a/src/libstddjb/env_merge.c b/src/libstddjb/env_merge.c
index 9129cf3..5543e08 100644
--- a/src/libstddjb/env_merge.c
+++ b/src/libstddjb/env_merge.c
@@ -16,7 +16,8 @@ size_t env_merge (char const **v, size_t vmax, char const *const *envp, size_t e
{
size_t split = str_chr(modifs + i, '=') ;
size_t j = 0 ;
- for (; j < vlen ; j++) if (!strncmp(modifs + i, v[j], split+1)) break ;
+ for (; j < vlen ; j++)
+ if (!strncmp(modifs + i, v[j], split) && (v[j][split] == '=')) break ;
if (j < vlen) v[j] = v[--vlen] ;
if (modifs[i + split]) v[vlen++] = modifs + i ;
}