home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / unreleased / patches / 5.6a.025 < prev    next >
Encoding:
Internet Message Format  |  2000-01-12  |  2.9 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 5.6a.025 (extra)
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.6a.025 (extra)
  8. Problem:    Win32 GUI: The tables for toupper() and tolower() are initialized
  9.         too late. (Mike Steed)
  10. Solution:   Move the initialization to win32_init() and call it from main().
  11. Files:        src/main.c, src/os_w32.c, src/proto/os_w32.pro
  12.  
  13.  
  14. *** ../vim-5.6a.24/src/main.c    Tue Jan 11 16:54:05 2000
  15. --- src/main.c    Thu Jan 13 22:58:37 2000
  16. ***************
  17. *** 310,315 ****
  18. --- 310,319 ----
  19.       setlocale(LC_ALL, "");    /* for ctype() and the like */
  20.   #endif
  21.   
  22. + #ifdef MSWIN
  23. +     win32_init();        /* init toupper() and tolower() tables */
  24. + #endif
  25.   #ifdef USE_GUI_MAC
  26.       /* Macinthosh needs this before any memory is allocated. */
  27.       gui_prepare(&argc, argv);    /* Prepare for possibly starting GUI sometime */
  28. *** ../vim-5.6a.24/src/os_win32.c    Mon Dec 20 09:59:14 1999
  29. --- src/os_win32.c    Thu Jan 13 22:49:23 2000
  30. ***************
  31. *** 1474,1492 ****
  32.       char **argv)
  33.   {
  34.       char    temp[256];
  35. -     int        i;
  36.   
  37.       /* store the name of the executable, may be used for $VIM */
  38.       GetModuleFileName(NULL, temp, 255);
  39.       if (*temp != NUL)
  40.       exe_name = FullName_save((char_u *)temp, FALSE);
  41.   
  42. -     /* Init the tables for toupper() and tolower() */
  43. -     for (i = 0; i < 256; ++i)
  44. -     toupper_tab[i] = tolower_tab[i] = i;
  45. -     CharUpperBuff(toupper_tab, 256);
  46. -     CharLowerBuff(tolower_tab, 256);
  47.   #ifdef USE_GUI_WIN32
  48.       return OK;        /* GUI always has a tty */
  49.   #else
  50. --- 1474,1485 ----
  51. ***************
  52. *** 1496,1501 ****
  53. --- 1489,1508 ----
  54.   #endif
  55.   }
  56.   
  57. + /*
  58. +  * Init the tables for toupper() and tolower().
  59. +  */
  60. +     void
  61. + win32_init(void)
  62. + {
  63. +     int        i;
  64. +     /* Init the tables for toupper() and tolower() */
  65. +     for (i = 0; i < 256; ++i)
  66. +     toupper_tab[i] = tolower_tab[i] = i;
  67. +     CharUpperBuff(toupper_tab, 256);
  68. +     CharLowerBuff(tolower_tab, 256);
  69. + }
  70.   
  71.   /*
  72.    * Return TRUE if the input comes from a terminal, FALSE otherwise.
  73. *** ../vim-5.6a.24/src/proto/os_win32.pro    Mon Dec 20 09:58:57 1999
  74. --- src/proto/os_win32.pro    Thu Jan 13 22:59:24 2000
  75. ***************
  76. *** 6,11 ****
  77. --- 6,12 ----
  78.   void mch_windinit __ARGS((void));
  79.   void mch_windexit __ARGS((int r));
  80.   int mch_check_win __ARGS((int argc, char **argv));
  81. + void win32_init __ARGS((void));
  82.   int mch_input_isatty __ARGS((void));
  83.   void fname_case __ARGS((char_u *name));
  84.   void mch_settitle __ARGS((char_u *title, char_u *icon));
  85. *** ../vim-5.6a.24/src/version.c    Thu Jan 13 23:00:08 2000
  86. --- src/version.c    Thu Jan 13 22:59:39 2000
  87. ***************
  88. *** 420,421 ****
  89. --- 420,423 ----
  90.   {   /* Add new patch number below this line */
  91. + /**/
  92. +     25,
  93.   /**/
  94.  
  95. -- 
  96. hundred-and-one symptoms of being an internet addict:
  97. 154. You fondle your mouse.
  98.  
  99. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\--
  100.   \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /
  101.