~mrms/osum

ff26d47c19603bb403000caf34d43796a277588a — Marek Ma┼íkarinec 7 months ago d8699dd
Fix walk behavior
2 files changed, 5 insertions(+), 8 deletions(-)

M os.um
A test/one/two/three/four
M os.um => os.um +4 -8
@@ 133,23 133,19 @@ fn walk*(dir: str, cb: fn(file: str), args: WalkArgs = {}): Errno {
                if f == "." || f == ".." {
                        continue
                }
                

                fullpath := filepath.join(dir, f)
                                  
                if args.skipLinks && islink(fullpath) {
                        continue
                }

                if isdir(fullpath) {
                        walk(fullpath, cb, args)
                        if !args.excludeDirs {
                        if !args.excludeDirs && !(args.skipLinks && islink(fullpath)) {
                                cb(fullpath)
                        }
                } else {
                        cb(fullpath)
                }
        }
        

        return 0
}



@@ 237,4 233,4 @@ fn main() {
                printf("link failed: %v\n", strerror(errno))
        }
        chmod("test", 0744)
}
\ No newline at end of file
}

A test/one/two/three/four => test/one/two/three/four +1 -0
@@ 0,0 1,1 @@
../../two
\ No newline at end of file