diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-11-25 11:55:37 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-11-26 11:32:06 +0000 |
| commit | a1990d2bd9d1f54baf83802e2874069ee73b4fa4 (patch) | |
| tree | 0ae1e16cc24fc433027ea78ca2af972ad3dcef83 /pkg | |
| parent | 66b9eb592907501b2caa11568313a324ee7cd6b8 (diff) | |
tools/syz-declextract: accept manager config
Make the tool accept a manager config.
This will be required for dynamic extraction of info from the kernel.
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/osutil/osutil.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/osutil/osutil.go b/pkg/osutil/osutil.go index 465679ced..3c98a7f68 100644 --- a/pkg/osutil/osutil.go +++ b/pkg/osutil/osutil.go @@ -333,10 +333,13 @@ func Abs(path string) string { if wd1, err := os.Getwd(); err == nil && wd1 != wd { panic(fmt.Sprintf("wd changed: %q -> %q", wd, wd1)) } - if path == "" || filepath.IsAbs(path) { + if path == "" { return path } - return filepath.Join(wd, path) + if !filepath.IsAbs(path) { + path = filepath.Join(wd, path) + } + return filepath.Clean(path) } // MonotonicNano returns monotonic time in nanoseconds from some unspecified point in time. |
