Explorar o código

Force Glob to return linux path

Toby Chui %!s(int64=3) %!d(string=hai) anos
pai
achega
8fda8bacef
Modificáronse 1 ficheiros con 10 adicións e 1 borrados
  1. 10 1
      mod/filesystem/abstractions/smbfs/smbfs.go

+ 10 - 1
mod/filesystem/abstractions/smbfs/smbfs.go

@@ -202,7 +202,16 @@ func (a ServerMessageBlockFileSystemAbstraction) IsDir(realpath string) bool {
 
 func (a ServerMessageBlockFileSystemAbstraction) Glob(realpathWildcard string) ([]string, error) {
 	realpathWildcard = toWinPath(filterFilepath(realpathWildcard))
-	return a.share.Glob(realpathWildcard)
+	filteredMatches := []string{}
+	matches, err := a.share.Glob(realpathWildcard)
+	if err != nil {
+		return []string{}, err
+	}
+
+	for _, thisMatch := range matches {
+		filteredMatches = append(filteredMatches, filepath.ToSlash(thisMatch))
+	}
+	return filteredMatches, nil
 }
 
 func (a ServerMessageBlockFileSystemAbstraction) GetFileSize(realpath string) int64 {