Karsten Hopp 6c20e5
To: vim-dev@vim.org
Karsten Hopp 6c20e5
Subject: Patch 7.2.443
Karsten Hopp 6c20e5
Fcc: outbox
Karsten Hopp 6c20e5
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 6c20e5
Mime-Version: 1.0
Karsten Hopp 6c20e5
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 6c20e5
Content-Transfer-Encoding: 8bit
Karsten Hopp 6c20e5
------------
Karsten Hopp 6c20e5
Karsten Hopp 6c20e5
Patch 7.2.443 
Karsten Hopp 6c20e5
Problem:    Using taglist() on a tag file with duplicate fields generates an 
Karsten Hopp 6c20e5
            internal error. (Peter Odding) 
Karsten Hopp 6c20e5
Solution:   Check for duplicate field names. 
Karsten Hopp 6c20e5
Files:      src/eval.c, src/proto/eval.pro, src/tag.c 
Karsten Hopp 6c20e5
Karsten Hopp 6c20e5
Karsten Hopp 6c20e5
*** ../vim-7.2.442/src/eval.c	2010-05-28 22:06:41.000000000 +0200
Karsten Hopp 6c20e5
--- src/eval.c	2010-06-12 19:59:09.000000000 +0200
Karsten Hopp 6c20e5
***************
Karsten Hopp 6c20e5
*** 451,457 ****
Karsten Hopp 6c20e5
  static void dictitem_remove __ARGS((dict_T *dict, dictitem_T *item));
Karsten Hopp 6c20e5
  static dict_T *dict_copy __ARGS((dict_T *orig, int deep, int copyID));
Karsten Hopp 6c20e5
  static long dict_len __ARGS((dict_T *d));
Karsten Hopp 6c20e5
- static dictitem_T *dict_find __ARGS((dict_T *d, char_u *key, int len));
Karsten Hopp 6c20e5
  static char_u *dict2string __ARGS((typval_T *tv, int copyID));
Karsten Hopp 6c20e5
  static int get_dict_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
Karsten Hopp 6c20e5
  static char_u *echo_string __ARGS((typval_T *tv, char_u **tofree, char_u *numbuf, int copyID));
Karsten Hopp 6c20e5
--- 451,456 ----
Karsten Hopp 6c20e5
***************
Karsten Hopp 6c20e5
*** 7012,7018 ****
Karsten Hopp 6c20e5
   * If "len" is negative use strlen(key).
Karsten Hopp 6c20e5
   * Returns NULL when not found.
Karsten Hopp 6c20e5
   */
Karsten Hopp 6c20e5
!     static dictitem_T *
Karsten Hopp 6c20e5
  dict_find(d, key, len)
Karsten Hopp 6c20e5
      dict_T	*d;
Karsten Hopp 6c20e5
      char_u	*key;
Karsten Hopp 6c20e5
--- 7011,7017 ----
Karsten Hopp 6c20e5
   * If "len" is negative use strlen(key).
Karsten Hopp 6c20e5
   * Returns NULL when not found.
Karsten Hopp 6c20e5
   */
Karsten Hopp 6c20e5
!     dictitem_T *
Karsten Hopp 6c20e5
  dict_find(d, key, len)
Karsten Hopp 6c20e5
      dict_T	*d;
Karsten Hopp 6c20e5
      char_u	*key;
Karsten Hopp 6c20e5
*** ../vim-7.2.442/src/proto/eval.pro	2010-01-19 15:51:29.000000000 +0100
Karsten Hopp 6c20e5
--- src/proto/eval.pro	2010-06-12 19:59:13.000000000 +0200
Karsten Hopp 6c20e5
***************
Karsten Hopp 6c20e5
*** 56,61 ****
Karsten Hopp 6c20e5
--- 56,62 ----
Karsten Hopp 6c20e5
  void dictitem_free __ARGS((dictitem_T *item));
Karsten Hopp 6c20e5
  int dict_add __ARGS((dict_T *d, dictitem_T *item));
Karsten Hopp 6c20e5
  int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str));
Karsten Hopp 6c20e5
+ dictitem_T *dict_find __ARGS((dict_T *d, char_u *key, int len));
Karsten Hopp 6c20e5
  char_u *get_dict_string __ARGS((dict_T *d, char_u *key, int save));
Karsten Hopp 6c20e5
  long get_dict_number __ARGS((dict_T *d, char_u *key));
Karsten Hopp 6c20e5
  char_u *get_function_name __ARGS((expand_T *xp, int idx));
Karsten Hopp 6c20e5
*** ../vim-7.2.442/src/tag.c	2010-02-24 14:46:58.000000000 +0100
Karsten Hopp 6c20e5
--- src/tag.c	2010-06-12 20:01:45.000000000 +0200
Karsten Hopp 6c20e5
***************
Karsten Hopp 6c20e5
*** 3771,3777 ****
Karsten Hopp 6c20e5
  static int add_tag_field __ARGS((dict_T *dict, char *field_name, char_u *start, char_u *end));
Karsten Hopp 6c20e5
  
Karsten Hopp 6c20e5
  /*
Karsten Hopp 6c20e5
!  * Add a tag field to the dictionary "dict"
Karsten Hopp 6c20e5
   */
Karsten Hopp 6c20e5
      static int
Karsten Hopp 6c20e5
  add_tag_field(dict, field_name, start, end)
Karsten Hopp 6c20e5
--- 3771,3778 ----
Karsten Hopp 6c20e5
  static int add_tag_field __ARGS((dict_T *dict, char *field_name, char_u *start, char_u *end));
Karsten Hopp 6c20e5
  
Karsten Hopp 6c20e5
  /*
Karsten Hopp 6c20e5
!  * Add a tag field to the dictionary "dict".
Karsten Hopp 6c20e5
!  * Return OK or FAIL.
Karsten Hopp 6c20e5
   */
Karsten Hopp 6c20e5
      static int
Karsten Hopp 6c20e5
  add_tag_field(dict, field_name, start, end)
Karsten Hopp 6c20e5
***************
Karsten Hopp 6c20e5
*** 3783,3788 ****
Karsten Hopp 6c20e5
--- 3784,3800 ----
Karsten Hopp 6c20e5
      char_u	buf[MAXPATHL];
Karsten Hopp 6c20e5
      int		len = 0;
Karsten Hopp 6c20e5
  
Karsten Hopp 6c20e5
+     /* check that the field name doesn't exist yet */
Karsten Hopp 6c20e5
+     if (dict_find(dict, (char_u *)field_name, -1) != NULL)
Karsten Hopp 6c20e5
+     {
Karsten Hopp 6c20e5
+ 	if (p_verbose > 0)
Karsten Hopp 6c20e5
+ 	{
Karsten Hopp 6c20e5
+ 	    verbose_enter();
Karsten Hopp 6c20e5
+ 	    smsg((char_u *)_("Duplicate field name: %s"), field_name);
Karsten Hopp 6c20e5
+ 	    verbose_leave();
Karsten Hopp 6c20e5
+ 	}
Karsten Hopp 6c20e5
+ 	return FAIL;
Karsten Hopp 6c20e5
+     }
Karsten Hopp 6c20e5
      if (start != NULL)
Karsten Hopp 6c20e5
      {
Karsten Hopp 6c20e5
  	if (end == NULL)
Karsten Hopp 6c20e5
*** ../vim-7.2.442/src/version.c	2010-06-05 12:49:40.000000000 +0200
Karsten Hopp 6c20e5
--- src/version.c	2010-06-12 20:05:27.000000000 +0200
Karsten Hopp 6c20e5
***************
Karsten Hopp 6c20e5
*** 683,684 ****
Karsten Hopp 6c20e5
--- 683,686 ----
Karsten Hopp 6c20e5
  {   /* Add new patch number below this line */
Karsten Hopp 6c20e5
+ /**/
Karsten Hopp 6c20e5
+     443,
Karsten Hopp 6c20e5
  /**/
Karsten Hopp 6c20e5
Karsten Hopp 6c20e5
-- 
Karsten Hopp 6c20e5
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 6c20e5
191. You rate eating establishments not by the quality of the food,
Karsten Hopp 6c20e5
     but by the availability of electrical outlets for your PowerBook.
Karsten Hopp 6c20e5
Karsten Hopp 6c20e5
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 6c20e5
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 6c20e5
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 6c20e5
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///