aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-05-22 14:32:57 -0400
committerJustin M. Keyes <justinkz@gmail.com>2016-05-22 15:12:02 -0400
commit96f834a8424e889c274273080954c9711f1c9acc (patch)
treef924ff7fddda743d4ed21db35f4a668e44defd42 /src
parent849d61b5510b3a3449c2664cb5a702126a2f6e8b (diff)
downloadrneovim-96f834a8424e889c274273080954c9711f1c9acc.tar.gz
rneovim-96f834a8424e889c274273080954c9711f1c9acc.tar.bz2
rneovim-96f834a8424e889c274273080954c9711f1c9acc.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/nvim/os/fs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index 49a74cf0d1..143a7160b0 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -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