oridb / mc

Myrddin Compiler
MIT License
387 stars 34 forks source link

Fix std.getcwd on OpenBSD -current #191

Closed cbvi closed 5 years ago

cbvi commented 5 years ago

The __getcwd syscall returning the length of the string was apparently unintended and was changed in 6.5 -current to return 0 on success: https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/kern/vfs_getcwd.c#rev1.33

This causes std.getcwd to return an empty string, which at least breaks mbld test.

This patch handles both the old and new behaviour.