os_nodetype: Return NODE_NORMAL if os_stat fails.

Conforms to Vim's mch_nodetype. Regression by 7db4a15.
buf_write() expects NODE_WRITABLE for character devices such as
/dev/stderr.

Closes #4772
This commit is contained in:
Justin M. Keyes
2016-05-22 14:32:57 -04:00
parent 849d61b551
commit 96f834a842
2 changed files with 18 additions and 5 deletions

View File

@@ -111,8 +111,8 @@ int os_nodetype(const char *name)
#endif
uv_stat_t statbuf;
if (os_stat(name, &statbuf) == 0) {
return NODE_NORMAL;
if (0 != os_stat(name, &statbuf)) {
return NODE_NORMAL; // File doesn't exist.
}
#ifndef WIN32