diff options
author | Andrey Nazarov <skuller@skuller.net> | 2007-12-21 21:24:49 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2007-12-21 21:24:49 +0000 |
commit | b1fa1be8b67e6d34a3d11fe4bfb9cd27191e2b28 (patch) | |
tree | 878887f017a82f7b861464c683d9a908e6d0a18e /source/sys_win.c | |
parent | a79ed051848531afb9a479f280bbcc39a4c29f44 (diff) |
Use Sys_Setenv for setting environment variables in a safe way.
Moved `writeconfig' command to client code section.
Moved `setenv' command to common code section.
Properly handle `--help' -and `--version' arguments on Unix.
Diffstat (limited to 'source/sys_win.c')
-rw-r--r-- | source/sys_win.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/sys_win.c b/source/sys_win.c index 03464da..0d14246 100644 --- a/source/sys_win.c +++ b/source/sys_win.c @@ -774,6 +774,15 @@ void Sys_Sleep( int msec ) { Sleep( msec ); } +void Sys_Setenv( const char *name, const char *value ) { +#if( _MSC_VER >= 1400 ) + _putenv_s( name, value ); +#else + _putenv( va( "%s=%s", name, value ) ); +#endif +} + + /* ================ Sys_Init |