From 6f334316175cee251aa8831c3cd795db36737c53 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 3 May 2017 13:33:38 +0200 Subject: clean path --- chksum/chksum.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'chksum') diff --git a/chksum/chksum.go b/chksum/chksum.go index b659be0..e21a2a8 100644 --- a/chksum/chksum.go +++ b/chksum/chksum.go @@ -12,6 +12,7 @@ import ( "hash" "io" "os" + "path" "regexp" ) @@ -29,7 +30,6 @@ var ( type Checksum struct { FileName string - Alg string Bytes []byte Hash hash.Hash } @@ -70,8 +70,7 @@ func Parse(r io.Reader) (Checklist, error) { return nil, err } cs := Checksum{ - FileName: match[2], - Alg: match[1], + FileName: path.Clean(match[2]), Bytes: bytes, Hash: hash(), } -- cgit v1.2.3