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

os_linux.v

This commit is contained in:
Alexander Medvednikov
2019-11-15 03:17:47 +03:00
parent 1dadf9d966
commit d1b8d34dd5
7 changed files with 84 additions and 27 deletions

View File

@ -24,12 +24,14 @@ pub fn tos(s byteptr, len int) string {
}
}
/*
pub fn tos_clone(s byteptr) string {
if s == 0 {
panic('tos: nil string')
}
return tos2(s).clone()
}
*/
// Same as `tos`, but calculates the length. Called by `string(bytes)` casts.
// Used only internally.
@ -53,6 +55,7 @@ pub fn tos3(s *C.char) string {
}
}
/*
pub fn (a string) clone() string {
mut b := string {
len: a.len
@ -64,3 +67,4 @@ pub fn (a string) clone() string {
b[a.len] = `\0`
return b
}
*/