sal: avoid STL asserts in create_merged_environment

"Assertion failed: sequence not ordered" printed when running smoketest

Change-Id: Id9b7541f43342adf62137718dc332c0187c32f57
This commit is contained in:
Michael Stahl
2014-07-23 21:12:55 +02:00
parent 1d36d91d0a
commit 73b2ef39fc

View File

@@ -129,6 +129,11 @@ namespace /* private */
p += l + 1;
}
FreeEnvironmentStrings(env);
// it is apparently possible that the environment is not completely
// sorted; Cygwin may append entries, which breaks the equal_range
std::stable_sort(environment->begin(), environment->end(),
less_environment_variable());
}
/* the environment list must be sorted, new values