setarch: fix generation of new PATH environment variable.
* The insertion index didn't take into account the fact that some paths don't get added before the index is calculated. This resulted in the requested arch paths ending up in reverse if we were already in the requested arch environment. Fixes #12125.
This commit is contained in:
parent
ae59605d24
commit
a5bc477663
@ -109,7 +109,7 @@ compute_new_paths(const char* architecture, BStringList& _paths)
|
||||
int32 index = primaryBinDirectories.IndexOf(path);
|
||||
if (index >= 0) {
|
||||
if (insertionIndex < 0)
|
||||
insertionIndex = i;
|
||||
insertionIndex = _paths.CountStrings();
|
||||
} else if (!is_primary_architecture(
|
||||
guess_architecture_for_path(path))) {
|
||||
// a non-primary architecture path -- skip
|
||||
|
Loading…
Reference in New Issue
Block a user