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 / patches / 6.3 / 6.3.026 < prev    next >
Encoding:
Internet Message Format  |  2004-09-12  |  3.0 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.3.026
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.3.026
  11. Problem:    When ~/.vim/after/syntax/syncolor.vim contains a command that
  12.             reloads the colors an enless loop and/or a crash may occur.
  13. Solution:   Only free the old value of an option when it was originally
  14.             allocated.  Limit recursiveness of init_highlight() to 5 levels.
  15. Files:      src/option.c, src/syntax.c
  16.  
  17.  
  18. *** ../vim-6.3.025/src/option.c    Thu Aug 26 16:01:15 2004
  19. --- src/option.c    Mon Sep 13 15:42:46 2004
  20. ***************
  21. *** 4597,4602 ****
  22. --- 4597,4603 ----
  23.       char_u    *s, *p;
  24.       int        did_chartab = FALSE;
  25.       char_u    **gvarp;
  26. +     int        free_oldval = (options[opt_idx].flags & P_ALLOCED);
  27.   
  28.       /* Get the global option to compare with, otherwise we would have to check
  29.        * two values for all local options. */
  30. ***************
  31. *** 5729,5736 ****
  32.   #endif
  33.       /*
  34.        * Free string options that are in allocated memory.
  35.        */
  36. !     if (options[opt_idx].flags & P_ALLOCED)
  37.           free_string_option(oldval);
  38.       if (new_value_alloced)
  39.           options[opt_idx].flags |= P_ALLOCED;
  40. --- 5730,5739 ----
  41.   #endif
  42.       /*
  43.        * Free string options that are in allocated memory.
  44. +      * Use "free_oldval", because recursiveness may change the flags under
  45. +      * our fingers (esp. init_highlight()).
  46.        */
  47. !     if (free_oldval)
  48.           free_string_option(oldval);
  49.       if (new_value_alloced)
  50.           options[opt_idx].flags |= P_ALLOCED;
  51. *** ../vim-6.3.025/src/syntax.c    Wed Jun  9 14:56:25 2004
  52. --- src/syntax.c    Mon Sep 13 15:44:04 2004
  53. ***************
  54. *** 6016,6022 ****
  55.        * If syntax highlighting is enabled load the highlighting for it.
  56.        */
  57.       if (get_var_value((char_u *)"g:syntax_on") != NULL)
  58. !     (void)cmd_runtime((char_u *)"syntax/syncolor.vim", TRUE);
  59.   #endif
  60.   }
  61.   
  62. --- 6016,6033 ----
  63.        * If syntax highlighting is enabled load the highlighting for it.
  64.        */
  65.       if (get_var_value((char_u *)"g:syntax_on") != NULL)
  66. !     {
  67. !     static int    recursive = 0;
  68. !     if (recursive >= 5)
  69. !         EMSG(_("E679: recursive loop loading syncolor.vim"));
  70. !     else
  71. !     {
  72. !         ++recursive;
  73. !         (void)cmd_runtime((char_u *)"syntax/syncolor.vim", TRUE);
  74. !         --recursive;
  75. !     }
  76. !     }
  77.   #endif
  78.   }
  79.   
  80. *** ../vim-6.3.025/src/version.c    Sun Sep  5 20:53:04 2004
  81. --- src/version.c    Mon Sep 13 16:33:19 2004
  82. ***************
  83. *** 643,644 ****
  84. --- 643,646 ----
  85.   {   /* Add new patch number below this line */
  86. + /**/
  87. +     26,
  88.   /**/
  89.  
  90. -- 
  91. A special law prohibits unmarried women from parachuting on Sunday or she
  92. shall risk arrest, fine, and/or jailing.
  93.         [real standing law in Florida, United States of America]
  94.  
  95.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  96. ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  97. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  98.  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
  99.