Mercurial > vim
diff src/message.c @ 9605:846d4bad2df7 v7.4.2080
commit https://github.com/vim/vim/commit/b869c0da31716ff14bbfd63346d140d0a1d68af7
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 20 00:10:51 2016 +0200
patch 7.4.2080
Problem: When using PERROR() on some systems assert_fails() does not see
the error.
Solution: Make PERROR() always report the error.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 20 Jul 2016 00:15:06 +0200 |
parents | 716382aaa0c0 |
children | bc0a6d9a9a07 |
line wrap: on
line diff
--- 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 *