Skip to content

Commit

Permalink
Merge pull request #143 from nairaner/master
Browse files Browse the repository at this point in the history
Fix parsing of env causing issues with wine kill
  • Loading branch information
brezerk committed May 3, 2019
2 parents da1f303 + 5445dbf commit 2ff6a9e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/q4wine-lib/q4wine-lib.cpp
Expand Up @@ -1460,11 +1460,9 @@ bool corelib::runProcess(const QString &exec, const QStringList &args, QString d
int exitcode = myProcess.exitCode();
QProcess::ExitStatus exitStatus = myProcess.exitStatus();
if (showLog && (exitcode != 0 || exitStatus == QProcess::CrashExit)){
// Getting env LANG variable
QString lang=this->getLocale();

// Read STDERR with locale support
QTextCodec *codec = QTextCodec::codecForName(lang.toLatin1());
// Read STDERR with locale encoding
QTextCodec *codec = QTextCodec::codecForLocale();
QString string = codec->toUnicode(myProcess.readAllStandardError());

if (!string.isEmpty()){
Expand Down Expand Up @@ -1551,7 +1549,7 @@ bool corelib::killWineServer(const QString &prefix_path, const QString &pid){

while(!e_line.isNull()) {
qDebug() << e_line;
foreach (const QString &env, e_line.split("\0")) {
foreach (const QString &env, e_line.split(QChar('\0'))) {
QRegExp rx_env("^(.*)=(.*)?");
if (rx_env.indexIn(env) != -1){
if (keywords.contains(rx_env.cap(1))){
Expand Down

0 comments on commit 2ff6a9e

Please sign in to comment.