make behavior consistent in adding compiler bindirs to Path
When running the compiled user program, current compiler's binary directories should be added to the beginning of the Path environment variable instead of the end, in order to avoid loading other user-installed versions of MinGW libraries (such as libstdc++). Previously, in openShell of mainwindow.cpp the behavior has already been updated, but in executablerunner.cpp and ojproblemcasesrunner.cpp, the behavior is different. Now they have been changed to be consistent with the one in openShell.
This commit is contained in:
parent
e920d230df
commit
a96af19f2e
|
@ -108,7 +108,7 @@ void ExecutableRunner::run()
|
|||
}
|
||||
pathAdded.append(pSettings->dirs().appDir());
|
||||
if (!path.isEmpty()) {
|
||||
path+= PATH_SEPARATOR + pathAdded.join(PATH_SEPARATOR);
|
||||
path= pathAdded.join(PATH_SEPARATOR) + PATH_SEPARATOR + path;
|
||||
} else {
|
||||
path = pathAdded.join(PATH_SEPARATOR);
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ void OJProblemCasesRunner::runCase(int index,POJProblemCase problemCase)
|
|||
}
|
||||
pathAdded.append(pSettings->dirs().appDir());
|
||||
if (!path.isEmpty()) {
|
||||
path+= PATH_SEPARATOR + pathAdded.join(PATH_SEPARATOR);
|
||||
path= pathAdded.join(PATH_SEPARATOR) + PATH_SEPARATOR + path;
|
||||
} else {
|
||||
path = pathAdded.join(PATH_SEPARATOR);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue