Browse Source

Force Glob to return linux path

Toby Chui 3 years ago
parent
commit
8fda8bacef
1 changed files with 10 additions and 1 deletions
  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) {
 func (a ServerMessageBlockFileSystemAbstraction) Glob(realpathWildcard string) ([]string, error) {
 	realpathWildcard = toWinPath(filterFilepath(realpathWildcard))
 	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 {
 func (a ServerMessageBlockFileSystemAbstraction) GetFileSize(realpath string) int64 {