Skip to content

Commit

Permalink
os/gcfg: fix gcfg adaptfile dogetfilepath (#3587)
Browse files Browse the repository at this point in the history
  • Loading branch information
ynwcel authored May 20, 2024
1 parent 737da95 commit 1455440
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions os/gcfg/gcfg_adapter_file_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ func (a *AdapterFile) doGetFilePath(fileName string) (filePath string) {
// Searching local file system.
if filePath == "" {
// Absolute path.
if filePath = gfile.RealPath(fileName); filePath != "" && !gfile.IsDir(filePath) {
/*if filePath = gfile.RealPath(fileName); filePath != "" && !gfile.IsDir(filePath) {
return
}
}*/
a.searchPaths.RLockFunc(func(array []string) {
for _, searchPath := range array {
searchPath = gstr.TrimRight(searchPath, `\/`)
Expand All @@ -235,6 +235,12 @@ func (a *AdapterFile) doGetFilePath(fileName string) (filePath string) {
}
})
}
if filePath == "" {
// Absolute path.
if filePath = gfile.RealPath(fileName); filePath != "" && !gfile.IsDir(filePath) {
return
}
}
return
}

Expand Down

0 comments on commit 1455440

Please sign in to comment.