diff --git a/vlib/os/os.v b/vlib/os/os.v index d2b935dac4..f011bb2ebc 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -199,7 +199,7 @@ pub fn dir(opath string) string { if opath == '' { return '.' } - path := opath.replace_each(['/', path_separator, r'\', path_separator]) + path := opath.replace_each(['/', path_separator, '\\', path_separator]) pos := path.last_index(path_separator) or { return '.' } if pos == 0 && path_separator == '/' { return '/' @@ -215,7 +215,7 @@ pub fn base(opath string) string { if opath == '' { return '.' } - path := opath.replace_each(['/', path_separator, r'\', path_separator]) + path := opath.replace_each(['/', path_separator, '\\', path_separator]) if path == path_separator { return path_separator } @@ -231,7 +231,7 @@ pub fn base(opath string) string { // file_name will return all characters found after the last occurence of `path_separator`. // file extension is included. pub fn file_name(opath string) string { - path := opath.replace_each(['/', path_separator, r'\', path_separator]) + path := opath.replace_each(['/', path_separator, '\\', path_separator]) return path.all_after_last(path_separator) } @@ -431,7 +431,7 @@ fn executable_fallback() string { } } if !is_abs_path(exepath) { - rexepath := exepath.replace_each(['/', path_separator, r'\', path_separator]) + rexepath := exepath.replace_each(['/', path_separator, '\\', path_separator]) if rexepath.contains(path_separator) { exepath = join_path_single(os.wd_at_startup, exepath) } else {