Repository: shssoichiro/oxipng (language: rust)

Issue:
Recursive not working on Windows
The recursive option doesn't work and says failed to open file for reading.
Version is oxipng 2.2.0
This is the output
```
konack@DESKTOP:/mnt/c/users/accounting2/pictures/test$ ls Screenshots
desktop.ini  s.png
konack@DESKTOP:/mnt/c/users/accounting2/pictures/test$ oxipng *.png --opt 4 --recursive
Processing: *.png
Failed to open file for reading
```


Discussion / hints:
I wonder if it's specific to using --recursive with wildcards. Which shell are you using? Some shells also do automatic expansion of wildcards which can cause interesting behaviors as well.
Is it possible that an exit code is being thrown when it shouldn't? Just noticing that if I try and run on a structure like this from the `2012` directory:
```
- 2012
-- 01
-- 02
-- 03
```

The system exits immediately stating there were no matches. Wondering if the wildcard is throwing an exit 1 when it should really be continuing when `--recursive` is used.
Using a test structure as follows

> -test
>--1
>--2
>--3
>---test.png
"oxipng -r -o 6 test/" - runs correctly on this
"oxipng -r -o 6 test/ *.png" - fails immediately 

This behavior wouldn't be too bad if oxipng could ignore any files that don't have PNG headers and keep going, but if a file is passed without a png header the program will exit regardless of how many more files need to be checked. Fixing the wildcard issue won't fix this behavior fully as there are cases where files may be labeled .png but really be some other file.

I've tried extending error handling to not exit on bad header data but my ability with rust is lacking.
I got the same problem:

```
C:\oxipng-5.0.1-x86_64-pc-windows-msvc> oxipng -r -P C:\*.png
Processing: C:\*.png
Failed to open file for reading

C:\oxipng-5.0.1-x86_64-pc-windows-msvc> oxipng -r -P C:\

C:\oxipng-5.0.1-x86_64-pc-windows-msvc> oxipng -P -V -r C:\
oxipng 5.0.1

C:\oxipng-5.0.1-x86_64-pc-windows-msvc> oxipng -P -v -r C:\

```
… and it don't tell me what's going wrong!

Seems like the remaining issue might be windows specific. I'll see what I can do.
> I got the same problem:
> 
> ```
> C:\oxipng-5.0.1-x86_64-pc-windows-msvc> oxipng -r -P C:\*.png
> Processing: C:\*.png
> Failed to open file for reading
> 
> C:\oxipng-5.0.1-x86_64-pc-windows-msvc> oxipng -r -P C:\
> 
> C:\oxipng-5.0.1-x86_64-pc-windows-msvc> oxipng -P -V -r C:\
> oxipng 5.0.1
> 
> C:\oxipng-5.0.1-x86_64-pc-windows-msvc> oxipng -P -v -r C:\
> ```
> 
> … and it don't tell me what's going wrong!

Can reproduce on my Windows 10 machine

Fix patch:
diff --git a/src/main.rs b/src/main.rs
index 4c4ae8e1..d0d14f0e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -359,8 +359,8 @@ fn collect_files(
                         in_out_pairs
                             .extend(collect_files(files, out_dir, out_file, recursive, false));
                     }
-                    Err(_) => {
-                        return Vec::new();
+                    Err(e) => {
+                        warn!("{}: {}", input.display(), e);
                     }
                 }
             } else {


Test patch: