]> git.pld-linux.org Git - packages/vim.git/blob - 7.0.140
- new
[packages/vim.git] / 7.0.140
1 To: vim-dev@vim.org
2 Subject: Patch 7.0.140
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.140 (after 7.0.134)
11 Problem:    Comparing recursively looped List or Dictionary doesn't work well.
12 Solution:   Detect comparing a List or Dictionary with itself.
13 Files:      src/eval.c
14
15
16 *** ../vim-7.0.139/src/eval.c   Sun Oct 15 22:38:41 2006
17 --- src/eval.c  Sun Oct 15 22:30:09 2006
18 ***************
19 *** 5451,5456 ****
20 --- 5451,5458 ----
21   {
22       listitem_T        *item1, *item2;
23   
24 +     if (l1 == l2)
25 +       return TRUE;
26       if (list_len(l1) != list_len(l2))
27         return FALSE;
28   
29 ***************
30 *** 5487,5492 ****
31 --- 5489,5496 ----
32       dictitem_T        *item2;
33       int               todo;
34   
35 +     if (d1 == d2)
36 +       return TRUE;
37       if (dict_len(d1) != dict_len(d2))
38         return FALSE;
39   
40 ***************
41 *** 5522,5531 ****
42       static int  recursive = 0;            /* cach recursive loops */
43       int               r;
44   
45 !     /* Catch lists and dicts that have an endless loop by limiting
46 !      * recursiveness to 1000. */
47 !     if (tv1->v_type != tv2->v_type || recursive >= 1000)
48         return FALSE;
49   
50       switch (tv1->v_type)
51       {
52 --- 5526,5537 ----
53       static int  recursive = 0;            /* cach recursive loops */
54       int               r;
55   
56 !     if (tv1->v_type != tv2->v_type)
57         return FALSE;
58 +     /* Catch lists and dicts that have an endless loop by limiting
59 +      * recursiveness to 1000.  We guess they are equal then. */
60 +     if (recursive >= 1000)
61 +       return TRUE;
62   
63       switch (tv1->v_type)
64       {
65 *** ../vim-7.0.139/src/version.c        Tue Oct 17 13:39:36 2006
66 --- src/version.c       Tue Oct 17 15:15:04 2006
67 ***************
68 *** 668,669 ****
69 --- 668,671 ----
70   {   /* Add new patch number below this line */
71 + /**/
72 +     140,
73   /**/
74
75 -- 
76 hundred-and-one symptoms of being an internet addict:
77 54. You start tilting your head sideways to smile. :-)
78
79  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
80 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
81 \\\        download, build and distribute -- http://www.A-A-P.org        ///
82  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.028324 seconds and 3 git commands to generate.