@@ -701,6 +701,7 @@ get_current_directory :: proc() -> string {
return string(cwd)
}
if Errno(get_last_error()) != ERANGE {
+ delete(buf)
return ""
resize(&buf, len(buf)+page_size)
@@ -651,6 +651,7 @@ get_current_directory :: proc() -> string {
@@ -823,6 +823,7 @@ get_current_directory :: proc() -> string {
return strings.string_from_nul_terminated_ptr(&buf[0], len(buf))
if _get_errno(res) != ERANGE {
@@ -649,6 +649,7 @@ get_current_directory :: proc() -> string {
resize(&buf, len(buf) + MAX_PATH)