diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-12 11:49:25 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-12 11:49:25 +0000 |
commit | ac5c734f32ccd9787762253192de0d559609abae (patch) | |
tree | 9a652b97ea5faa3c9379b58275b5a101e2076b90 /util.c | |
parent | a2093a06980c0ef77ac4631e8b8f383be904f06a (diff) | |
download | perl-ac5c734f32ccd9787762253192de0d559609abae.tar.gz |
support win32_putenv()
p4raw-id: //depot/perl@2898
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 25 |
1 files changed, 10 insertions, 15 deletions
@@ -1607,21 +1607,16 @@ my_setenv(char *nam,char *val) #else /* !USE_WIN32_RTL_ENV */ - /* The sane way to deal with the environment. - * Has these advantages over putenv() & co.: - * * enables us to store a truly empty value in the - * environment (like in UNIX). - * * we don't have to deal with RTL globals, bugs and leaks. - * * Much faster. - * Why you may want to enable USE_WIN32_RTL_ENV: - * * environ[] and RTL functions will not reflect changes, - * which might be an issue if extensions want to access - * the env. via RTL. This cuts both ways, since RTL will - * not see changes made by extensions that call the Win32 - * functions directly, either. - * GSAR 97-06-07 - */ - SetEnvironmentVariable(nam,val); + register char *envstr; + STRLEN len = strlen(nam) + 3; + if (!val) { + val = ""; + } + len += strlen(val); + New(904, envstr, len, char); + (void)sprintf(envstr,"%s=%s",nam,val); + (void)PerlEnv_putenv(envstr); + Safefree(envstr); #endif } |