Browse Source

fix to avoid empty sub directory

pull/2/head
Chris Lu 11 years ago
parent
commit
d6aa6239de
  1. 6
      go/weed/weed_server/filer_server.go

6
go/weed/weed_server/filer_server.go

@ -157,10 +157,12 @@ func (fs *FilerServer) ensureFolderHasEntry(path string, sub string) (err error)
} else if e != nil {
return e
}
for _, v := range strings.Split(val, ":") {
list := strings.Split(val, ":")
for _, v := range list {
if v == sub {
return nil
}
}
return fs.db.Put([]byte(path), []byte(val+":"+sub), nil)
list = append(list, sub)
return fs.db.Put([]byte(path), []byte(strings.Join(list, ":")), nil)
}
Loading…
Cancel
Save