Skip to content

Commit

Permalink
Use portable qputenv/qunsetenv instead of platform specific setenv/_p…
Browse files Browse the repository at this point in the history
…utenv_s
  • Loading branch information
manisandro committed Feb 5, 2020
1 parent 2e766b6 commit 6742826
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/server/qgsserver.cpp
Expand Up @@ -290,11 +290,14 @@ bool QgsServer::init()

void QgsServer::putenv( const QString &var, const QString &val )
{
#ifdef _MSC_VER
_putenv_s( var.toStdString().c_str(), val.toStdString().c_str() );
#else
setenv( var.toStdString().c_str(), val.toStdString().c_str(), 1 );
#endif
if ( val.isEmpty() )
{
qunsetenv( var.toUtf8().data() );
}
else
{
qputenv( var.toUtf8().data(), val.toUtf8() );
}
sSettings()->load( var );
}

Expand Down

0 comments on commit 6742826

Please sign in to comment.