From 6aec9f7560daa005c513cde384f063f0b9b55dbc Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Wed, 4 Feb 2015 09:34:39 +0100 Subject: remove the (generally unsecure) setenv command --- src/qcommon/common.c | 30 ------------------------------ src/qcommon/qcommon.h | 2 -- 2 files changed, 32 deletions(-) (limited to 'src/qcommon') diff --git a/src/qcommon/common.c b/src/qcommon/common.c index 80a8df7b..59659ef0 100644 --- a/src/qcommon/common.c +++ b/src/qcommon/common.c @@ -2291,35 +2291,6 @@ static void Com_Crash_f( void ) { * ( volatile int * ) 0 = 0x12345678; } -/* -================== -Com_Setenv_f - -For controlling environment variables -================== -*/ -void Com_Setenv_f(void) -{ - int argc = Cmd_Argc(); - char *arg1 = Cmd_Argv(1); - - if(argc > 2) - { - char *arg2 = Cmd_ArgsFrom(2); - - Sys_SetEnv(arg1, arg2); - } - else if(argc == 2) - { - char *env = getenv(arg1); - - if(env) - Com_Printf("%s=%s\n", arg1, env); - else - Com_Printf("%s undefined\n", arg1); - } -} - /* ================== Com_ExecuteCfg @@ -2556,7 +2527,6 @@ void Com_Init( char *commandLine ) { Com_InitJournaling(); // Add some commands here already so users can use them from config files - Cmd_AddCommand ("setenv", Com_Setenv_f); if (com_developer && com_developer->integer) { Cmd_AddCommand ("error", Com_Error_f); diff --git a/src/qcommon/qcommon.h b/src/qcommon/qcommon.h index 0e90963a..e8764ef3 100644 --- a/src/qcommon/qcommon.h +++ b/src/qcommon/qcommon.h @@ -1093,8 +1093,6 @@ void Sys_Sleep(int msec); qboolean Sys_LowPhysicalMemory( void ); -void Sys_SetEnv(const char *name, const char *value); - typedef enum { DR_YES = 0, -- cgit