[ruby/find] Add Errno::EINVAL to list of ignored errors

This error can occur on Windows for certain filenames on certain
code pages.

Fixes [Bug #14591]

https://github.com/ruby/find/commit/0a474d1027
This commit is contained in:
Jeremy Evans 2021-06-17 09:09:16 -07:00 committed by Hiroshi SHIBATA
parent acfec23bec
commit 230111802c
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2
1 changed files with 2 additions and 2 deletions

View File

@ -49,14 +49,14 @@ module Find
yield file.dup
begin
s = File.lstat(file)
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG, Errno::EINVAL
raise unless ignore_error
next
end
if s.directory? then
begin
fs = Dir.children(file, encoding: enc)
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG, Errno::EINVAL
raise unless ignore_error
next
end