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:
parent
6004b9ad52
commit
dec7a1befb
1 changed files with 3 additions and 5 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue