aboutsummaryrefslogtreecommitdiff
path: root/libbutl/filesystem.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-08-28 19:40:52 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-08-31 12:07:10 +0300
commitab080add26815ceef754c6ebaa2f2512e1f954cf (patch)
treecd93483b330d114e3427632290f368226e726996 /libbutl/filesystem.cxx
parent584e8fce074286cbf1a5bf0c79265f789c050c59 (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.cxx11
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;
}
}