mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: fix os.walk, when passing paths ending with path_separator (#8672)
This commit is contained in:
parent
4646c414d8
commit
f2ad6dd4d9
@ -463,8 +463,12 @@ pub fn walk(path string, f fn (string)) {
|
||||
return
|
||||
}
|
||||
mut files := ls(path) or { return }
|
||||
mut local_path_separator := path_separator
|
||||
if path.ends_with(path_separator) {
|
||||
local_path_separator = ''
|
||||
}
|
||||
for file in files {
|
||||
p := path + path_separator + file
|
||||
p := path + local_path_separator + file
|
||||
if is_dir(p) && !is_link(p) {
|
||||
walk(p, f)
|
||||
} else if exists(p) {
|
||||
|
Loading…
Reference in New Issue
Block a user