1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-11-22 00:15:39 +00:00

Recognize path when validating

Fixes #11. After changing the directory to the root directory specified,
we want to call lstat on a relative path, instead of joining the
full root path with the file name.

Signed-off-by: Stephen Chung <schung@redhat.com>
This commit is contained in:
Stephen Chung 2016-07-08 17:00:07 -04:00
parent d5aab78911
commit 0a89fa8f23

View file

@ -50,7 +50,7 @@ func Check(root string, dh *DirectoryHierarchy, keywords []string) (*Result, err
creator.curSet = nil
}
case RelativeType, FullType:
info, err := os.Lstat(filepath.Join(root, e.Path()))
info, err := os.Lstat(e.Path())
if err != nil {
return nil, err
}