From ab080add26815ceef754c6ebaa2f2512e1f954cf Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 28 Aug 2020 19:40:52 +0300 Subject: Fix assertion failure in path_search() on Windows Also fix the similar potential assertion failure in fdstream. --- libbutl/filesystem.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'libbutl/filesystem.cxx') diff --git a/libbutl/filesystem.cxx b/libbutl/filesystem.cxx index 7db26a5..9e8a232 100644 --- a/libbutl/filesystem.cxx +++ b/libbutl/filesystem.cxx @@ -2573,11 +2573,14 @@ namespace butl // // Make sure that the error denotes errno portable code. // - assert (e.code ().category () == generic_category ()); + if (e.code ().category () == generic_category ()) + { + int ec (e.code ().value ()); + if (ec == ENOENT || ec == ENOTDIR) + return; + } - int ec (e.code ().value ()); - if (ec != ENOENT && ec != ENOTDIR) - throw; + throw; } } -- cgit v1.1