1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

os: re-add the leak in os.join_path (the os.join_path(x, ...arr) case should be handled by V). Add a memleak free os.join_path_single version.

This commit is contained in:
Delyan Angelov
2021-11-22 14:40:55 +02:00
parent 5e1782bf9c
commit 7a0dc60d04
7 changed files with 60 additions and 39 deletions

View File

@ -191,7 +191,7 @@ pub fn file_size(path string) u64 {
pub fn mv(src string, dst string) ? {
mut rdst := dst
if is_dir(rdst) {
rdst = join_path(rdst.trim_right(path_separator), file_name(src.trim_right(path_separator)))
rdst = join_path_single(rdst.trim_right(path_separator), file_name(src.trim_right(path_separator)))
}
$if windows {
w_src := src.replace('/', '\\')