kinit: remove code for always false condition

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-11-01 08:14:00 +02:00
parent 91fd8f3fde
commit 4d2b877aaf

View file

@ -397,7 +397,6 @@ static QByteArray execpath_avoid_loops( const QByteArray& exec, int envc, const
static pid_t launch(int argc, const char *_name, const char *args,
const char *cwd=0, int envc=0, const char *envs=0,
bool reset_env = false,
const char *tty=0, bool avoid_loops = false,
const char* startup_id_str = "0" ) // krazy:exclude=doublequote_chars
{
@ -477,22 +476,6 @@ static pid_t launch(int argc, const char *_name, const char *args,
(void)chdir(cwd);
}
if( reset_env ) // KWRAPPER/SHELL
{
QList<QByteArray> unset_envs;
for( int tmp_env_count = 0;
environ[tmp_env_count];
tmp_env_count++)
unset_envs.append( environ[ tmp_env_count ] );
foreach(const QByteArray &tmp, unset_envs)
{
int pos = tmp.indexOf( '=' );
if( pos >= 0 )
unsetenv( tmp.left( pos ));
}
}
for (int i = 0; i < envc; i++)
{
putenv((char *)envs);
@ -1078,7 +1061,6 @@ static bool handle_launcher_request(int sock, const char *who)
}
pid = launch( argc, name, args, cwd, envc, envs,
false,
tty, avoid_loops, startup_id_str );
if (pid && (d.result == 0))