From 73b2ef39fc5e748e80dca72268b67e5a0d6da8ff Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 23 Jul 2014 21:12:55 +0200 Subject: sal: avoid STL asserts in create_merged_environment "Assertion failed: sequence not ordered" printed when running smoketest Change-Id: Id9b7541f43342adf62137718dc332c0187c32f57 --- sal/osl/w32/procimpl.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sal/osl/w32') diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx index bccda26b49d7..e560a7bb571e 100644 --- a/sal/osl/w32/procimpl.cxx +++ b/sal/osl/w32/procimpl.cxx @@ -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 -- cgit