Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.1
-
None
Description
Windows.pm's delete_files_by_pattern() subroutine can delete unintended files if an environment variable is passed to it as the base directory argument and the environment variable isn't defined.
Example:
delete_files_by_pattern('$TEMP', '.')
A trailing '/' is always added to the base directory path because find is called and it will fail if a wildcard pattern is used and the base directory doesn't contain a trailing slash. If $TEMP isn't defined on the computer, the subroutine will attempt to delete . from /.