From 4b55f2a805638a3d817a6df37c5540243887274a Mon Sep 17 00:00:00 2001 From: Tim Champagne Date: Thu, 8 May 2003 22:47:31 +0000 Subject: Forgot these files during my last commit CVS patchset: 4802 CVS date: 2003/05/08 22:47:31 --- win32/contrib/setenv.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 win32/contrib/setenv.c (limited to 'win32/contrib/setenv.c') diff --git a/win32/contrib/setenv.c b/win32/contrib/setenv.c new file mode 100755 index 000000000..ffd85f872 --- /dev/null +++ b/win32/contrib/setenv.c @@ -0,0 +1,19 @@ + +#include + +#include +#include + +/* This function will leak a small amount of memory */ +void setenv(const char *name, const char *val, int _xx) +{ + int len = strlen(name) + strlen(val) + 2; + char *env = malloc(len); + + if (env != NULL) { + strcpy(env, name); + strcat(env, "="); + strcat(env, val); + putenv(env); + } +} -- cgit v1.2.3