1
0
Fork 1
mirror of https://github.com/vbatts/tar-split.git synced 2024-11-16 21:38:38 +00:00

check: recognize correct path

Fixes #11. Check() changes its working directory to `root`, which
is specified as an argument. Thus, it shouldn't open
a file using its absolute path; instead it should open the file
with the relative path to the root.

Signed-off-by: Stephen Chung <schung@redhat.com>
This commit is contained in:
Stephen Chung 2016-07-14 16:33:23 -04:00
parent 3dc8a31929
commit a0b06e0224

View file

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