summaryrefslogtreecommitdiff
path: root/src/message.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-20 00:10:51 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-20 00:10:51 +0200
commitb869c0da31716ff14bbfd63346d140d0a1d68af7 (patch)
tree5a182ff0c5cc310da39c4892cc0aed7903ee82bf /src/message.c
parent53bdec2ac9b994eee9c60f2ab9ad8a8afb2b9594 (diff)
downloadvim-git-b869c0da31716ff14bbfd63346d140d0a1d68af7.tar.gz
patch 7.4.2080v7.4.2080
Problem: When using PERROR() on some systems assert_fails() does not see the error. Solution: Make PERROR() always report the error.
Diffstat (limited to 'src/message.c')
-rw-r--r--src/message.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/message.c b/src/message.c
index 7aec2d613..c49429d0e 100644
--- a/src/message.c
+++ b/src/message.c
@@ -521,6 +521,21 @@ emsg_not_now(void)
return FALSE;
}
+#if !defined(HAVE_STRERROR) || defined(PROTO)
+/*
+ * Replacement for perror() that behaves more or less like emsg() was called.
+ * v:errmsg will be set and called_emsg will be set.
+ */
+ void
+do_perror(char *msg)
+{
+ perror(msg);
+ ++emsg_silent;
+ emsg((char_u *)msg);
+ --emsg_silent;
+}
+#endif
+
/*
* emsg() - display an error message
*