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.
Files:      src/vim.h, src/message.c, src/proto/message.pro


*** ../vim-7.4.2079/src/vim.h   2016-07-19 23:12:18.716611687 +0200
--- src/vim.h   2016-07-20 00:05:01.275820207 +0200
***************
*** 1652,1658 ****
  #ifdef HAVE_STRERROR
  # define PERROR(msg)              (void)emsg3((char_u *)"%s: %s", (char_u 
*)msg, (char_u *)strerror(errno))
  #else
! # define PERROR(msg)              perror(msg)
  #endif
  
  typedef long  linenr_T;               /* line number type */
--- 1652,1658 ----
  #ifdef HAVE_STRERROR
  # define PERROR(msg)              (void)emsg3((char_u *)"%s: %s", (char_u 
*)msg, (char_u *)strerror(errno))
  #else
! # define PERROR(msg)              do_perror(msg)
  #endif
  
  typedef long  linenr_T;               /* line number type */
*** ../vim-7.4.2079/src/message.c       2016-07-19 12:33:39.938005838 +0200
--- src/message.c       2016-07-20 00:09:03.417301133 +0200
***************
*** 521,526 ****
--- 521,541 ----
      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
   *
*** ../vim-7.4.2079/src/proto/message.pro       2016-01-19 13:21:55.841334333 
+0100
--- src/proto/message.pro       2016-07-20 00:09:07.533258324 +0200
***************
*** 8,13 ****
--- 8,14 ----
  void reset_last_sourcing(void);
  void msg_source(int attr);
  int emsg_not_now(void);
+ void do_perror(char *msg);
  int emsg(char_u *s);
  int emsg2(char_u *s, char_u *a1);
  void emsg_invreg(int name);
*** ../vim-7.4.2079/src/version.c       2016-07-20 00:03:14.212934385 +0200
--- src/version.c       2016-07-20 00:05:26.887553706 +0200
***************
*** 760,761 ****
--- 760,763 ----
  {   /* Add new patch number below this line */
+ /**/
+     2080,
  /**/

-- 
ARTHUR:  I am your king!
WOMAN:   Well, I didn't vote for you.
ARTHUR:  You don't vote for kings.
WOMAN:   Well, 'ow did you become king then?
                                  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui