[vlc-commits] Fix compilation if getenv() is missing

Rémi Denis-Courmont git at videolan.org
Sun Feb 13 09:15:19 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Feb 13 10:14:56 2011 +0200| [6dd92709b35f462f9db83d1e1bebb18e58daff7b] | committer: Rémi Denis-Courmont

Fix compilation if getenv() is missing

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6dd92709b35f462f9db83d1e1bebb18e58daff7b
---

 compat/setenv.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/compat/setenv.c b/compat/setenv.c
index 049effc..bfc2e16 100644
--- a/compat/setenv.c
+++ b/compat/setenv.c
@@ -27,6 +27,7 @@
 
 int setenv (const char *name, const char *value, int override)
 {
+#ifdef HAVE_GETENV
     if (override == 0 && getenv (name) != NULL)
         return 0;
 
@@ -40,6 +41,9 @@ int setenv (const char *name, const char *value, int override)
     sprintf (var, "%s=%s", name, value);
     /* This leaks memory. This is unavoidable. */
     return putenv (var);
+#else
+    return -1;
+#endif
 }
 
 int unsetenv (const char *name)



More information about the vlc-commits mailing list