opendir_r: bugfix: bad first iteration of readdir
authorBrett Gordon <beretta42@gmail.com>
Sat, 5 Mar 2016 14:55:08 +0000 (09:55 -0500)
committerBrett Gordon <beretta42@gmail.com>
Sat, 5 Mar 2016 14:55:08 +0000 (09:55 -0500)
Library/libs/opendir_r.c

index 9fe3d9a..c32ffde 100644 (file)
@@ -20,5 +20,7 @@ DIR *opendir_r(DIR *dir, char *path)
        if ((dir->dd_fd = open(path, O_RDONLY | O_CLOEXEC)) < 0)
                return NULL;
        dir->dd_loc = 0;
+       dir->_priv.next = 0;
+       dir->_priv.last = 0;
        return dir;
 }