Karsten Hopp aa63ac
To: vim-dev@vim.org
Karsten Hopp aa63ac
Subject: patch 7.1.079
Karsten Hopp aa63ac
Fcc: outbox
Karsten Hopp aa63ac
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp aa63ac
Mime-Version: 1.0
Karsten Hopp aa63ac
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp aa63ac
Content-Transfer-Encoding: 8bit
Karsten Hopp aa63ac
------------
Karsten Hopp aa63ac
Karsten Hopp aa63ac
Patch 7.1.079
Karsten Hopp aa63ac
Problem:    When the locale is "C" and 'encoding' is "latin1" then the "@"
Karsten Hopp aa63ac
	    character in 'isfname', 'isprint', etc. doesn't pick up accented
Karsten Hopp aa63ac
	    characters.
Karsten Hopp aa63ac
Solution:   Instead of isalpha() use MB_ISLOWER() and MB_ISUPPER().
Karsten Hopp aa63ac
Files:	    src/charset.c, src/macros.h
Karsten Hopp aa63ac
Karsten Hopp aa63ac
Karsten Hopp aa63ac
*** ../vim-7.1.078/src/charset.c	Mon Aug  6 22:27:12 2007
Karsten Hopp aa63ac
--- src/charset.c	Tue Aug 14 13:43:30 2007
Karsten Hopp aa63ac
***************
Karsten Hopp aa63ac
*** 207,213 ****
Karsten Hopp aa63ac
  	    }
Karsten Hopp aa63ac
  	    while (c <= c2)
Karsten Hopp aa63ac
  	    {
Karsten Hopp aa63ac
! 		if (!do_isalpha || isalpha(c)
Karsten Hopp aa63ac
  #ifdef FEAT_FKMAP
Karsten Hopp aa63ac
  			|| (p_altkeymap && (F_isalpha(c) || F_isdigit(c)))
Karsten Hopp aa63ac
  #endif
Karsten Hopp aa63ac
--- 207,216 ----
Karsten Hopp aa63ac
  	    }
Karsten Hopp aa63ac
  	    while (c <= c2)
Karsten Hopp aa63ac
  	    {
Karsten Hopp aa63ac
! 		/* Use the MB_ functions here, because isalpha() doesn't
Karsten Hopp aa63ac
! 		 * work properly when 'encoding' is "latin1" and the locale is
Karsten Hopp aa63ac
! 		 * "C".  */
Karsten Hopp aa63ac
! 		if (!do_isalpha || MB_ISLOWER(c) || MB_ISUPPER(c)
Karsten Hopp aa63ac
  #ifdef FEAT_FKMAP
Karsten Hopp aa63ac
  			|| (p_altkeymap && (F_isalpha(c) || F_isdigit(c)))
Karsten Hopp aa63ac
  #endif
Karsten Hopp aa63ac
*** ../vim-7.1.078/src/macros.h	Thu May 10 19:21:00 2007
Karsten Hopp aa63ac
--- src/macros.h	Sat Aug  4 13:44:18 2007
Karsten Hopp aa63ac
***************
Karsten Hopp aa63ac
*** 54,63 ****
Karsten Hopp aa63ac
  
Karsten Hopp aa63ac
  /*
Karsten Hopp aa63ac
   * toupper() and tolower() that use the current locale.
Karsten Hopp aa63ac
!  * On some systems toupper()/tolower() only work on lower/uppercase characters
Karsten Hopp aa63ac
   * Careful: Only call TOUPPER_LOC() and TOLOWER_LOC() with a character in the
Karsten Hopp aa63ac
   * range 0 - 255.  toupper()/tolower() on some systems can't handle others.
Karsten Hopp aa63ac
!  * Note: for UTF-8 use utf_toupper() and utf_tolower().
Karsten Hopp aa63ac
   */
Karsten Hopp aa63ac
  #ifdef MSWIN
Karsten Hopp aa63ac
  #  define TOUPPER_LOC(c)	toupper_tab[(c) & 255]
Karsten Hopp aa63ac
--- 54,65 ----
Karsten Hopp aa63ac
  
Karsten Hopp aa63ac
  /*
Karsten Hopp aa63ac
   * toupper() and tolower() that use the current locale.
Karsten Hopp aa63ac
!  * On some systems toupper()/tolower() only work on lower/uppercase
Karsten Hopp aa63ac
!  * characters, first use islower() or isupper() then.
Karsten Hopp aa63ac
   * Careful: Only call TOUPPER_LOC() and TOLOWER_LOC() with a character in the
Karsten Hopp aa63ac
   * range 0 - 255.  toupper()/tolower() on some systems can't handle others.
Karsten Hopp aa63ac
!  * Note: It is often better to use MB_TOLOWER() and MB_TOUPPER(), because many
Karsten Hopp aa63ac
!  * toupper() and tolower() implementations only work for ASCII.
Karsten Hopp aa63ac
   */
Karsten Hopp aa63ac
  #ifdef MSWIN
Karsten Hopp aa63ac
  #  define TOUPPER_LOC(c)	toupper_tab[(c) & 255]
Karsten Hopp aa63ac
*** ../vim-7.1.078/src/version.c	Wed Aug 15 20:07:53 2007
Karsten Hopp aa63ac
--- src/version.c	Wed Aug 15 20:39:18 2007
Karsten Hopp aa63ac
***************
Karsten Hopp aa63ac
*** 668,669 ****
Karsten Hopp aa63ac
--- 668,671 ----
Karsten Hopp aa63ac
  {   /* Add new patch number below this line */
Karsten Hopp aa63ac
+ /**/
Karsten Hopp aa63ac
+     79,
Karsten Hopp aa63ac
  /**/
Karsten Hopp aa63ac
Karsten Hopp aa63ac
-- 
Karsten Hopp aa63ac
You're as much use as a condom machine at the Vatican.
Karsten Hopp aa63ac
                  -- Rimmer to Holly in Red Dwarf 'Queeg'
Karsten Hopp aa63ac
Karsten Hopp aa63ac
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp aa63ac
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp aa63ac
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp aa63ac
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///