git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Logging: add I= element to transport-defer lines. Bug 2675
[exim.git]
/
src
/
src
/
setenv.c
diff --git
a/src/src/setenv.c
b/src/src/setenv.c
index 18d1519b600b68841cecabce829f42bf58479d07..90e679304f67c7240365bc51bc58ecde68cc49c3 100644
(file)
--- a/
src/src/setenv.c
+++ b/
src/src/setenv.c
@@
-2,8
+2,9
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) Michael Haardt 2015 */
-/* Copyright (c) Jeremy Harris 2015 - 2016 */
+/* Copyright (c) Michael Haardt 2015
+ * Copyright (c) Jeremy Harris 2015 - 2016
+ * Copyright (c) The Exim Maintainers 2016 */
/* See the file NOTICE for conditions of use and distribution. */
/* This module provides (un)setenv routines for those environments
/* See the file NOTICE for conditions of use and distribution. */
/* This module provides (un)setenv routines for those environments
@@
-16,7
+17,7
@@
setenv(const char * name, const char * val, int overwrite)
uschar * s;
if (Ustrchr(name, '=')) return -1;
if (overwrite || !getenv(name))
uschar * s;
if (Ustrchr(name, '=')) return -1;
if (overwrite || !getenv(name))
- putenv(CS string_copy_
malloc(string_sprintf("%s=%s", name, val)
));
+ putenv(CS string_copy_
perm(string_sprintf("%s=%s", name, val), FALSE
));
return 0;
}
return 0;
}
@@
-25,7
+26,6
@@
unsetenv(const char *name)
{
size_t len;
const char * end;
{
size_t len;
const char * end;
-char ** e;
extern char ** environ;
if (!name)
extern char ** environ;
if (!name)
@@
-43,7
+43,7
@@
len = end - name;
/* Find name in environment and move remaining variables down.
Do not early-out in case there are duplicate names. */
/* Find name in environment and move remaining variables down.
Do not early-out in case there are duplicate names. */
-for (e = environ; *e; e++)
+for (
char **
e = environ; *e; e++)
if (strncmp(*e, name, len) == 0 && (*e)[len] == '=')
{
char ** sp = e;
if (strncmp(*e, name, len) == 0 && (*e)[len] == '=')
{
char ** sp = e;