瀏覽代碼

Force Glob to return linux path

Toby Chui 3 年之前
父節點
當前提交
8fda8bacef
共有 1 個文件被更改,包括 10 次插入1 次删除
  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 {