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
Testsuite: Add EXIM_TEST_NUMBER to the environment
[exim.git]
/
src
/
src
/
setenv.c
diff --git
a/src/src/setenv.c
b/src/src/setenv.c
index 6da56d58d7d7daab3e7e7af4d6d6806cb8c88e5b..ceeb8ef1ca67c8be1f6c253066a8c19bc47dbcf8 100644
(file)
--- a/
src/src/setenv.c
+++ b/
src/src/setenv.c
@@
-2,15
+2,16
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) Michael Haardt 2015 */
-/* Copyright (c) Jeremy Harris 2015 */
+/* 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
-lacking them in libraries. */
+lacking them in libraries.
It is #include'd by OS/os.c-foo files.
*/
-
static
int
+int
setenv(const char * name, const char * val, int overwrite)
{
uschar * s;
setenv(const char * name, const char * val, int overwrite)
{
uschar * s;
@@
-20,7
+21,7
@@
if (overwrite || !getenv(name))
return 0;
}
return 0;
}
-
static
int
+int
unsetenv(const char *name)
{
size_t len;
unsetenv(const char *name)
{
size_t len;
@@
-34,6
+35,9
@@
if (!name)
return -1;
}
return -1;
}
+if (!environ)
+ return 0;
+
for (end = name; *end != '=' && *end; ) end++;
len = end - name;
for (end = name; *end != '=' && *end; ) end++;
len = end - name;