Permalink
Browse files

fixed readdir on root

  • Loading branch information...
1 parent 77f201e commit 4403ac2fe1b47394b02c647afeeaef325525c67c @lalkaka lalkaka committed Apr 19, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 master/master.go
View
@@ -138,7 +138,13 @@ func (m *Master) ReadDir(args *sfs.ReadDirArgs, ret *sfs.ReadDirReturn) os.Error
return err
}
- cnt := dirs.Len()
+ var cnt int
+ if dirs != nil {
+ cnt = dirs.Len()
+ } else {
+ cnt = 0
+ }
+
retSlice := make([]string, cnt + len(files))
var i int

0 comments on commit 4403ac2

Please sign in to comment.