diff options
author | Francis Lavoie <[email protected]> | 2024-11-13 03:55:51 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2024-11-13 03:55:51 -0500 |
commit | 315715e90ffa25c4ad0d8a96e828dbdf6f638583 (patch) | |
tree | 3b22815c57acc730c90b6dcaa740a34a7073a36b /caddyconfig | |
parent | 238f1108e6600049d9041abc88db24526ee4f882 (diff) | |
download | caddy-315715e90ffa25c4ad0d8a96e828dbdf6f638583.tar.gz caddy-315715e90ffa25c4ad0d8a96e828dbdf6f638583.zip |
core: Implement FastAbs to avoid repeated os.Getwd calls (#6687)
* core: Implement FastAbs to avoid repeated os.Getwd calls
* Lint
* Rename files
Diffstat (limited to 'caddyconfig')
-rw-r--r-- | caddyconfig/caddyfile/parse.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/caddyconfig/caddyfile/parse.go b/caddyconfig/caddyfile/parse.go index e19b3b97d..d04a1ac46 100644 --- a/caddyconfig/caddyfile/parse.go +++ b/caddyconfig/caddyfile/parse.go @@ -423,7 +423,7 @@ func (p *parser) doImport(nesting int) error { // make path relative to the file of the _token_ being processed rather // than current working directory (issue #867) and then use glob to get // list of matching filenames - absFile, err := filepath.Abs(p.Dispenser.File()) + absFile, err := caddy.FastAbs(p.Dispenser.File()) if err != nil { return p.Errf("Failed to get absolute path of file: %s: %v", p.Dispenser.File(), err) } @@ -622,7 +622,7 @@ func (p *parser) doSingleImport(importFile string) ([]Token, error) { // Tack the file path onto these tokens so errors show the imported file's name // (we use full, absolute path to avoid bugs: issue #1892) - filename, err := filepath.Abs(importFile) + filename, err := caddy.FastAbs(importFile) if err != nil { return nil, p.Errf("Failed to get absolute path of file: %s: %v", importFile, err) } |