mirror of
https://gitee.com/johng/gf.git
synced 2024-11-29 18:57:44 +08:00
os/gcfg: fix gcfg adaptfile dogetfilepath (#3587)
This commit is contained in:
parent
737da954a0
commit
1455440efa
@ -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, `\/`)
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user