mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
replace ugly tos2(bytes)
with string(bytes)
This commit is contained in:
8
os/os.v
8
os/os.v
@ -27,8 +27,8 @@ import const (
|
||||
)
|
||||
|
||||
fn C.getline(voidptr, voidptr, voidptr) int
|
||||
|
||||
fn C.ftell(fp voidptr) int
|
||||
fn C.getenv(byteptr) byteptr
|
||||
|
||||
fn todo_remove(){}
|
||||
|
||||
@ -45,7 +45,7 @@ fn init_os_args(argc int, _argv *byteptr) []string {
|
||||
}
|
||||
|
||||
fn parse_windows_cmd_line(cmd byteptr) []string {
|
||||
s := tos2(cmd)
|
||||
s := string(cmd)
|
||||
return s.split(' ')
|
||||
}
|
||||
|
||||
@ -313,7 +313,7 @@ pub fn getenv(key string) string {
|
||||
if isnil(s) {
|
||||
return ''
|
||||
}
|
||||
return tos2(s)
|
||||
return string(s)
|
||||
}
|
||||
|
||||
// `file_exists` returns true if `path` exists.
|
||||
@ -473,4 +473,4 @@ fn on_segfault(f voidptr) {
|
||||
# sa.sa_flags = SA_SIGINFO;
|
||||
# sigaction(SIGSEGV, &sa, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user