Skip to content
Permalink
Browse files

Use portable qputenv/qunsetenv instead of platform specific setenv/_p…

…utenv_s
  • Loading branch information
manisandro committed Feb 5, 2020
1 parent 2e766b6 commit 674282658cf3fb22a6b60b04686ed96b8cd20f78
Showing with 8 additions and 5 deletions.
  1. +8 −5 src/server/qgsserver.cpp
@@ -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 );
}

0 comments on commit 6742826

Please sign in to comment.
You can’t perform that action at this time.