Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows - customFlags should use filepath.Clean() instead of path.Clean() #22367

Closed
tintinweb opened this issue Feb 23, 2021 · 1 comment · Fixed by #26404
Closed

Windows - customFlags should use filepath.Clean() instead of path.Clean() #22367

tintinweb opened this issue Feb 23, 2021 · 1 comment · Fixed by #26404
Labels

Comments

@tintinweb
Copy link
Member

go-ethereum/cmd/utils/customflags.go is handling OS paths and therefore it should use filepath.Clean() (works for windows path separator) instead of path.Clean() (nix path separator)

return path.Clean(os.ExpandEnv(p))

path.Clean()
https://github.com/golang/go/blob/master/src/path/path.go#L51-L62

filepath.Clean()
https://github.com/golang/go/blob/master/src/path/filepath/path.go#L66-L79

Expected behaviour

should cleanup for OS path separator

Actual behaviour

path.Clean() assumes the path separator is / while it might be \\

@karalabe
Copy link
Member

Good catch. Though we'd need to update that sole test too to pass on Windows if we update the test. I assume it will break because it explicitly hard codes Linux paths and expansions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants