neovim/neovim — pull request #322 by oni-link (2014-03-07 15:48:31+00:00)
Title: [RFC] Fix: Writing in possible invalid buffer in mch_dirname().

uv_cwd() returns with error -EINVAL, in case no valid
buffer is used. Do not try to copy an error message into the buffer.

For all other errors copy only the first len characters of the error
message into the buffer.