container/absolute: wrap safe stdlib functions
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m0s
Test / Hakurei (push) Successful in 2m57s
Test / Hpkg (push) Successful in 3m52s
Test / Sandbox (race detector) (push) Successful in 4m4s
Test / Hakurei (race detector) (push) Successful in 4m49s
Test / Flake checks (push) Successful in 1m31s

These functions do not change the absoluteness of a pathname.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-08-10 03:10:13 +09:00
parent 02271583fb
commit 41ac2be965
4 changed files with 64 additions and 12 deletions

View File

@@ -43,10 +43,10 @@ func (p *Proxy) Start() error {
}, nil)
} else {
var toolPath *container.Absolute
if a, err := container.NewAbsolute(p.name); err != nil {
if a, err := container.NewAbs(p.name); err != nil {
if p.name, err = exec.LookPath(p.name); err != nil {
return err
} else if toolPath, err = container.NewAbsolute(p.name); err != nil {
} else if toolPath, err = container.NewAbs(p.name); err != nil {
return err
}
} else {