• S
    Fix possibly endless loop in ReadDir iterator · af75314e
    sharkdp 提交于
    Certain directories in `/proc` can cause the `ReadDir`
    iterator to loop indefinitely. We get an error code (22) when
    calling libc's `readdir_r` on these directories, but `entry_ptr`
    is `NULL` at the same time, signalling the end of the directory
    stream.
    
    This change introduces an internal state to the iterator such
    that the `Some(Err(..))` value will only be returned once when
    calling `next`. Subsequent calls will return `None`.
    
    fixes #50619
    af75314e
fs.rs 30.6 KB