From d1912c4237638bf8231151fccaa87be27e995582 Mon Sep 17 00:00:00 2001 From: q66 Date: Tue, 8 Sep 2015 01:17:28 +0100 Subject: [PATCH] fix directory rewind on unix --- ostd/filesystem.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ostd/filesystem.hh b/ostd/filesystem.hh index 0090948..c9ed029 100644 --- a/ostd/filesystem.hh +++ b/ostd/filesystem.hh @@ -277,7 +277,10 @@ struct DirectoryStream { bool rewind() { if (!p_d) return false; rewinddir(p_d); - p_de = nullptr; + if (!pop_front() || !skip_dots()) { + close(); + return false; + } return true; }