mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: use path separator more consistently
This commit is contained in:
parent
08262b5c43
commit
a53c69de38
@ -790,6 +790,9 @@ fn new_v(args[]string) &V {
|
||||
}
|
||||
}
|
||||
|
||||
rdir := os.realpath( dir )
|
||||
rdir_name := os.filename( rdir )
|
||||
|
||||
obfuscate := args.contains('-obf')
|
||||
is_repl:=args.contains('-repl')
|
||||
pref := &Preferences {
|
||||
@ -812,7 +815,7 @@ fn new_v(args[]string) &V {
|
||||
build_mode: build_mode
|
||||
cflags: cflags
|
||||
ccompiler: find_c_compiler()
|
||||
building_v: !is_repl && (dir == 'compiler' ||
|
||||
building_v: !is_repl && (rdir_name == 'compiler' ||
|
||||
dir.contains('v/vlib'))
|
||||
}
|
||||
if pref.is_verbose || pref.is_debug {
|
||||
|
@ -466,7 +466,7 @@ fn path_sans_ext(path string) string {
|
||||
|
||||
|
||||
pub fn basedir(path string) string {
|
||||
pos := path.last_index('/')
|
||||
pos := path.last_index(PathSeparator)
|
||||
if pos == -1 {
|
||||
return path
|
||||
}
|
||||
@ -474,7 +474,7 @@ pub fn basedir(path string) string {
|
||||
}
|
||||
|
||||
pub fn filename(path string) string {
|
||||
return path.all_after('/')
|
||||
return path.all_after(PathSeparator)
|
||||
}
|
||||
|
||||
// get_line returns a one-line string from stdin
|
||||
@ -582,7 +582,7 @@ pub fn home_dir() string {
|
||||
}
|
||||
home += homepath
|
||||
}
|
||||
home += '/'
|
||||
home += PathSeparator
|
||||
return home
|
||||
}
|
||||
|
||||
@ -746,7 +746,7 @@ pub fn walk_ext(path, ext string) []string {
|
||||
if file.starts_with('.') {
|
||||
continue
|
||||
}
|
||||
p := path + '/' + file
|
||||
p := path + PathSeparator + file
|
||||
if os.is_dir(p) {
|
||||
res << walk_ext(p, ext)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user