restore: use case insensitive file name comparison on windows

This commit is contained in:
Michael Eischer
2024-06-29 19:54:12 +02:00
parent 013a6156bd
commit 168fc09d5f
4 changed files with 59 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
//go:build windows
// +build windows
package restorer
import "strings"
// toComparableFilename returns a filename suitable for equality checks. On Windows, it returns the
// uppercase version of the string. On all other systems, it returns the unmodified filename.
func toComparableFilename(path string) string {
// apparently NTFS internally uppercases filenames for comparision
return strings.ToUpper(path)
}