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 / 7.0 / 7.0.077 < prev    next >
Encoding:
Internet Message Format  |  2006-09-01  |  2.7 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 7.0.077
  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 7.0.077
  11. Problem:    ":unlet v:this_session" causes a crash. (Marius Roets)
  12. Solution:   When trying to unlet a fixed variable give an error message.
  13. Files:        src/eval.c
  14.  
  15.  
  16. *** ../vim-7.0.076/src/eval.c    Tue Aug 29 21:59:25 2006
  17. --- src/eval.c    Sat Sep  2 13:43:20 2006
  18. ***************
  19. *** 701,706 ****
  20. --- 701,707 ----
  21.   static void list_one_var_a __ARGS((char_u *prefix, char_u *name, int type, char_u *string));
  22.   static void set_var __ARGS((char_u *name, typval_T *varp, int copy));
  23.   static int var_check_ro __ARGS((int flags, char_u *name));
  24. + static int var_check_fixed __ARGS((int flags, char_u *name));
  25.   static int tv_check_lock __ARGS((int lock, char_u *name));
  26.   static void copy_tv __ARGS((typval_T *from, typval_T *to));
  27.   static int item_copy __ARGS((typval_T *from, typval_T *to, int deep, int copyID));
  28. ***************
  29. *** 3364,3369 ****
  30. --- 3365,3372 ----
  31.       hi = hash_find(ht, varname);
  32.       if (!HASHITEM_EMPTY(hi))
  33.       {
  34. +         if (var_check_fixed(HI2DI(hi)->di_flags, name))
  35. +         return FAIL;
  36.           if (var_check_ro(HI2DI(hi)->di_flags, name))
  37.           return FAIL;
  38.           delete_var(ht, hi);
  39. ***************
  40. *** 17818,17824 ****
  41.   }
  42.   
  43.   /*
  44. !  * Return TRUE if di_flags "flags" indicate read-only variable "name".
  45.    * Also give an error message.
  46.    */
  47.       static int
  48. --- 17821,17827 ----
  49.   }
  50.   
  51.   /*
  52. !  * Return TRUE if di_flags "flags" indicates variable "name" is read-only.
  53.    * Also give an error message.
  54.    */
  55.       static int
  56. ***************
  57. *** 17834,17839 ****
  58. --- 17837,17859 ----
  59.       if ((flags & DI_FLAGS_RO_SBX) && sandbox)
  60.       {
  61.       EMSG2(_(e_readonlysbx), name);
  62. +     return TRUE;
  63. +     }
  64. +     return FALSE;
  65. + }
  66. + /*
  67. +  * Return TRUE if di_flags "flags" indicates variable "name" is fixed.
  68. +  * Also give an error message.
  69. +  */
  70. +     static int
  71. + var_check_fixed(flags, name)
  72. +     int        flags;
  73. +     char_u    *name;
  74. + {
  75. +     if (flags & DI_FLAGS_FIX)
  76. +     {
  77. +     EMSG2(_("E795: Cannot delete variable %s"), name);
  78.       return TRUE;
  79.       }
  80.       return FALSE;
  81. *** ../vim-7.0.076/src/version.c    Tue Aug 29 22:35:11 2006
  82. --- src/version.c    Sat Sep  2 13:39:36 2006
  83. ***************
  84. *** 668,669 ****
  85. --- 668,671 ----
  86.   {   /* Add new patch number below this line */
  87. + /**/
  88. +     77,
  89.   /**/
  90.  
  91. -- 
  92.             ### Hiroshima 45, Chernobyl 86, Windows 95 ###
  93.  
  94.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  95. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  96. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  97.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  98.