src: fix use of uv_cwd, len includes the NULL byte

pull/5010/head
Saúl Ibarra Corretgé 2014-03-13 00:22:50 +01:00 committed by Fedor Indutny
parent 42b9343710
commit a0a180a0ad
1 changed files with 1 additions and 7 deletions

View File

@ -1598,16 +1598,10 @@ static void Cwd(const FunctionCallbackInfo<Value>& args) {
return env->ThrowUVException(err, "uv_cwd");
}
#ifdef _WIN32
// TODO(tjfontaine) in the future libuv will report the size include the null
// for now only windows does, remove conditionals after libuv upgrade
cwd_len -= 1;
#endif
Local<String> cwd = String::NewFromUtf8(env->isolate(),
buf,
String::kNormalString,
cwd_len);
cwd_len - 1);
args.GetReturnValue().Set(cwd);
}