Copyright year updates (things touched in 2016)
[exim.git] / src / src / setenv.c
index 6da56d58d7d7daab3e7e7af4d6d6806cb8c88e5b..ceeb8ef1ca67c8be1f6c253066a8c19bc47dbcf8 100644 (file)
@@ -2,15 +2,16 @@
 *     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
-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;
@@ -20,7 +21,7 @@ if (overwrite || !getenv(name))
 return 0;
 }
 
-static int
+int
 unsetenv(const char *name)
 {
 size_t len;
@@ -34,6 +35,9 @@ if (!name)
   return -1;
   }
 
+if (!environ)
+  return 0;
+
 for (end = name; *end != '=' && *end; ) end++;
 len = end - name;