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

Windows: fix some heap corruptions, fix msvc not building with unicode flags, fix os.getwd, fix mscrazy using a less recent installation

This commit is contained in:
Emily Hudson
2019-07-24 14:00:26 +01:00
committed by Alexander Medvednikov
parent 0bbefca875
commit 32aae80a64
5 changed files with 108 additions and 104 deletions

View File

@@ -703,9 +703,9 @@ pub fn chdir(path string) {
pub fn getwd() string {
$if windows {
max := 512 // MAX_PATH * sizeof(wchar_t)
max := 1024 // MAX_PATH * sizeof(wchar_t)
buf := &u16(malloc(max))
if C._wgetcwd(buf, max) == 0 {
if C._wgetcwd(buf, max/2) == 0 {
return ''
}
return string_from_wide(buf)