updated for version 7.0-077 v7.0.077
authorBram Moolenaar <Bram@vim.org>
Sat, 2 Sep 2006 11:41:07 +0000 (11:41 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 2 Sep 2006 11:41:07 +0000 (11:41 +0000)
src/eval.c
src/version.c

index 23119735128ea2f435b6fe5a50bcd0c4cc9f4ba0..0762cabacb30765070ca73333b5d6a791cdbb03f 100644 (file)
@@ -701,6 +701,7 @@ static void list_one_var __ARGS((dictitem_T *v, char_u *prefix));
 static void list_one_var_a __ARGS((char_u *prefix, char_u *name, int type, char_u *string));
 static void set_var __ARGS((char_u *name, typval_T *varp, int copy));
 static int var_check_ro __ARGS((int flags, char_u *name));
+static int var_check_fixed __ARGS((int flags, char_u *name));
 static int tv_check_lock __ARGS((int lock, char_u *name));
 static void copy_tv __ARGS((typval_T *from, typval_T *to));
 static int item_copy __ARGS((typval_T *from, typval_T *to, int deep, int copyID));
@@ -3364,6 +3365,8 @@ do_unlet(name, forceit)
        hi = hash_find(ht, varname);
        if (!HASHITEM_EMPTY(hi))
        {
+           if (var_check_fixed(HI2DI(hi)->di_flags, name))
+               return FAIL;
            if (var_check_ro(HI2DI(hi)->di_flags, name))
                return FAIL;
            delete_var(ht, hi);
@@ -17818,7 +17821,7 @@ set_var(name, tv, copy)
 }
 
 /*
- * Return TRUE if di_flags "flags" indicate read-only variable "name".
+ * Return TRUE if di_flags "flags" indicates variable "name" is read-only.
  * Also give an error message.
  */
     static int
@@ -17839,6 +17842,23 @@ var_check_ro(flags, name)
     return FALSE;
 }
 
+/*
+ * Return TRUE if di_flags "flags" indicates variable "name" is fixed.
+ * Also give an error message.
+ */
+    static int
+var_check_fixed(flags, name)
+    int                flags;
+    char_u     *name;
+{
+    if (flags & DI_FLAGS_FIX)
+    {
+       EMSG2(_("E795: Cannot delete variable %s"), name);
+       return TRUE;
+    }
+    return FALSE;
+}
+
 /*
  * Return TRUE if typeval "tv" is set to be locked (immutable).
  * Also give an error message, using "name".
index 722107c73fe7b57b5709c293c36e5005e2f96155..549f18bd6a8fd5e07f44720cc6aaed96777e39b2 100644 (file)
@@ -666,6 +666,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    77,
 /**/
     76,
 /**/