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; }