diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-08-28 19:40:52 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-08-31 12:07:10 +0300 |
commit | ab080add26815ceef754c6ebaa2f2512e1f954cf (patch) | |
tree | cd93483b330d114e3427632290f368226e726996 /libbutl/filesystem.cxx | |
parent | 584e8fce074286cbf1a5bf0c79265f789c050c59 (diff) |
Fix assertion failure in path_search() on Windows
Also fix the similar potential assertion failure in fdstream.
Diffstat (limited to 'libbutl/filesystem.cxx')
-rw-r--r-- | libbutl/filesystem.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
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; } } |