1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[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

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