To: vim-dev@vim.org
Subject: Patch 6.0.243
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 6.0.243
Problem:    Unix: "vim --version" outputs a NL before the last line instead of
            after it. (Charles Campbell)
Solution:   Send the NL to the same output stream as the text.
Files:      src/message.c, src/os_unix.c, src/proto/message.pro


*** ../vim60.242/src/message.c	Mon Feb 18 12:08:34 2002
--- src/message.c	Thu Feb 21 12:52:20 2002
***************
*** 26,32 ****
  #ifdef FEAT_MBYTE
  static char_u *screen_puts_mbyte __ARGS((char_u *s, int l, int attr));
  #endif
- static int  msg_use_printf __ARGS((void));
  static void msg_screen_putchar __ARGS((int c, int attr));
  static int  msg_check_screen __ARGS((void));
  static void redir_write __ARGS((char_u *s));
--- 26,31 ----
***************
*** 1809,1815 ****
   * different, e.g. for Win32 console) or we just don't know where the
   * cursor is.
   */
!     static int
  msg_use_printf()
  {
      return (!msg_check_screen()
--- 1808,1814 ----
   * different, e.g. for Win32 console) or we just don't know where the
   * cursor is.
   */
!     int
  msg_use_printf()
  {
      return (!msg_check_screen()
*** ../vim60.242/src/os_unix.c	Sun Feb 10 14:27:03 2002
--- src/os_unix.c	Thu Feb 21 12:52:40 2002
***************
*** 2340,2346 ****
  	if (!swapping_screen() || newline_on_exit)
  	{
  	    if (newline_on_exit || msg_didout)
! 		out_char('\n');
  	    else
  	    {
  		restore_cterm_colors();	/* get original colors back */
--- 2394,2411 ----
  	if (!swapping_screen() || newline_on_exit)
  	{
  	    if (newline_on_exit || msg_didout)
! 	    {
! 		/* Make sure the newline goes to the same stream as the text */
! 		if (msg_use_printf())
! 		{
! 		    if (info_message)
! 			mch_msg("\r\n");
! 		    else
! 			mch_errmsg("\r\n");
! 		}
! 		else
! 		    out_char('\n');
! 	    }
  	    else
  	    {
  		restore_cterm_colors();	/* get original colors back */
*** ../vim60.242/src/proto/message.pro	Tue Sep 25 21:49:19 2001
--- src/proto/message.pro	Thu Feb 21 12:52:09 2002
***************
*** 35,40 ****
--- 35,41 ----
  void msg_puts_long_attr __ARGS((char_u *longstr, int attr));
  void msg_puts_long_len_attr __ARGS((char_u *longstr, int len, int attr));
  void msg_puts_attr __ARGS((char_u *s, int attr));
+ int msg_use_printf __ARGS((void));
  void mch_errmsg __ARGS((char *str));
  void mch_msg __ARGS((char *str));
  void msg_moremsg __ARGS((int full));
*** ../vim60.242/src/version.c	Thu Feb 21 12:32:53 2002
--- src/version.c	Thu Feb 21 12:53:41 2002
***************
*** 608,609 ****
--- 608,611 ----
  {   /* Add new patch number below this line */
+ /**/
+     243,
  /**/

-- 
Managers are like cats in a litter box.  They instinctively shuffle things
around to conceal what they've done.
				(Scott Adams - The Dilbert principle)

 ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
 \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///