mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-26 01:55:39 +00:00
Merge pull request #22 from stephen679/set_aliasing
check: creator.curSet pointer aliasing
This commit is contained in:
commit
61dd456524
2 changed files with 5 additions and 2 deletions
4
check.go
4
check.go
|
@ -41,11 +41,11 @@ func Check(root string, dh *DirectoryHierarchy, keywords []string) (*Result, err
|
||||||
sort.Sort(byPos(creator.DH.Entries))
|
sort.Sort(byPos(creator.DH.Entries))
|
||||||
|
|
||||||
var result Result
|
var result Result
|
||||||
for _, e := range creator.DH.Entries {
|
for i, e := range creator.DH.Entries {
|
||||||
switch e.Type {
|
switch e.Type {
|
||||||
case SpecialType:
|
case SpecialType:
|
||||||
if e.Name == "/set" {
|
if e.Name == "/set" {
|
||||||
creator.curSet = &e
|
creator.curSet = &creator.DH.Entries[i]
|
||||||
} else if e.Name == "/unset" {
|
} else if e.Name == "/unset" {
|
||||||
creator.curSet = nil
|
creator.curSet = nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,6 +122,9 @@ func TestTimeComparison(t *testing.T) {
|
||||||
if err := os.Chtimes(fh.Name(), epoch, epoch); err != nil {
|
if err := os.Chtimes(fh.Name(), epoch, epoch); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
if err := os.Chtimes(dir, epoch, epoch); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
if err := fh.Close(); err != nil {
|
if err := fh.Close(); err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue