move initialization of quiet variable to do_init

fixes #511 - DLL init line is always printed even with -q.
regression from recent changes to init code.
This commit is contained in:
rofl0r 2023-05-20 15:27:22 +00:00
parent 42d2d95160
commit 0c795085fa

View File

@ -133,9 +133,15 @@ static unsigned get_rand_seed(void) {
}
static void do_init(void) {
char *env;
srand(get_rand_seed());
core_initialize();
env = getenv(PROXYCHAINS_QUIET_MODE_ENV_VAR);
if(env && *env == '1')
proxychains_quiet_mode = 1;
proxychains_write_log(LOG_PREFIX "DLL init: proxychains-ng %s\n", proxychains_get_version());
setup_hooks();
@ -307,10 +313,6 @@ static void get_chain_data(proxy_data * pd, unsigned int *proxy_count, chain_typ
exit(1);
}
env = getenv(PROXYCHAINS_QUIET_MODE_ENV_VAR);
if(env && *env == '1')
proxychains_quiet_mode = 1;
while(fgets(buf, sizeof(buf), file)) {
buff = buf;
/* remove leading whitespace */