-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not find file to scan! Error When File Name Contains Multiple Spaces #125
Comments
Thanks for the very thorough bug report @thelaughinglama . I'd have to go back and look at the commits where that line was changed to make sure there change wasn't made for a very good reason. |
It looks like in the past, it was escaping spaces (but that was only really valid for the I'm going to patch this issue and write some tests. I will let you know once the version with the patch is released. |
…en file names had spaces in them. Fixes #125
The patch has been applied in v2.2.3! Thanks for the bug report! |
I got an issue while checking if a file was infected. The problem arises when the file name contains multiple consecutive spaces. The current implementation alters the input file path by replacing consecutive spaces, leading to a "Could not find file to scan!" error during the scan.
Steps to Reproduce:
Attempt to scan a file with a name containing multiple consecutive spaces (e.g., "myfile name.txt").
The scan fails with a "Could not find file to scan!" error.
Expected Behavior:
The SDK should correctly handle file names with multiple consecutive spaces without altering the original file path, ensuring the file can be found and scanned.
Code snippet for reference
There are a couple of ways to go about it.
.trim()
is not the same as after replacing multiple spaces.I went through the commit history for this line
file = file.trim().replace(/\s+/g, ' ');
and saw that we went fromMore information on this change would be really helpful.
The text was updated successfully, but these errors were encountered: