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

all: variable sized options

This commit is contained in:
Emily Hudson
2020-05-31 11:57:26 +01:00
committed by GitHub
parent 3a36ed3802
commit 75eac291ac
10 changed files with 251 additions and 94 deletions

View File

@@ -798,12 +798,17 @@ pub fn get_raw_stdin() []byte {
for {
pos := buf + offset
res := C.ReadFile(h_input, pos, block_bytes, &bytes_read, 0)
offset += bytes_read
if !res {
break
}
offset += bytes_read
buf = v_realloc(buf, offset + block_bytes + (block_bytes-bytes_read))
}
C.CloseHandle(h_input)
return array{element_size: 1 data: voidptr(buf) len: offset cap: offset }
}
} $else {