1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

pkg/system: simplify IsAbs()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-03-09 16:35:12 +01:00
parent 6004b9ad52
commit dec7a1befb
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -130,12 +130,10 @@ func mkdirWithACL(name string, sddl string) error {
// by the daemon. This SHOULD be treated as absolute from a docker processing
// perspective.
func IsAbs(path string) bool {
if !filepath.IsAbs(path) {
if !strings.HasPrefix(path, string(os.PathSeparator)) {
return false
}
if filepath.IsAbs(path) || strings.HasPrefix(path, string(os.PathSeparator)) {
return true
}
return true
return false
}
// The origin of the functions below here are the golang OS and windows packages,