Patch 8.2.3292
Problem:    Underscore in very magic pattern causes a hang.  Pattern with \V
            are case sensitive. (Yutao Yuan)
Solution:   Adjust condition for magicness and advance pointer. (Christian
            Brabandt, closes #8707, closes #8704, closes #8705)
Files:      src/search.c, src/testdir/test_search.vim


*** ../vim-8.2.3291/src/search.c        2021-08-01 12:44:31.856542627 +0200
--- src/search.c        2021-08-05 15:20:17.820185295 +0200
***************
*** 445,451 ****
                return TRUE;
            p += l;
        }
!       else if (*p == '\\' && magic_val == MAGIC_ON)
        {
            if (p[1] == '_' && p[2] != NUL)  // skip "\_X"
                p += 3;
--- 445,451 ----
                return TRUE;
            p += l;
        }
!       else if (*p == '\\' && magic_val <= MAGIC_ON)
        {
            if (p[1] == '_' && p[2] != NUL)  // skip "\_X"
                p += 3;
***************
*** 460,465 ****
--- 460,467 ----
        {
            if (p[1] != NUL)  // skip "_X" and %X
                p += 2;
+           else
+               p++;
        }
        else if (MB_ISUPPER(*p))
            return TRUE;
*** ../vim-8.2.3291/src/testdir/test_search.vim 2021-08-01 12:44:31.856542627 
+0200
--- src/testdir/test_search.vim 2021-08-05 15:20:17.820185295 +0200
***************
*** 1962,1967 ****
--- 1962,1978 ----
    call assert_equal(['abc', 'ABC', 'Abc', ''],
          \ getline(1, '$'))
  
+   call setline(1, input)
+   call cursor(1,1)
+   " \Vabc should match everything
+   %s/\Vabc//g
+   call assert_equal(['', '', '', ''], getline(1, '$'))
+ 
+   call setline(1, input + ['_abc'])
+   " _ matches normally
+   %s/\v_.*//g
+   call assert_equal(['abc', 'ABC', 'Abc', 'abC', ''], getline(1, '$'))
+ 
    set smartcase& ignorecase&
    bw!
  endfunc
*** ../vim-8.2.3291/src/version.c       2021-08-05 15:11:04.577422906 +0200
--- src/version.c       2021-08-05 15:24:35.283597372 +0200
***************
*** 757,758 ****
--- 757,760 ----
  {   /* Add new patch number below this line */
+ /**/
+     3292,
  /**/

-- 
GUARD #2:  It could be carried by an African swallow!
GUARD #1:  Oh, yeah, an African swallow maybe, but not a European swallow,
           that's my point.
GUARD #2:  Oh, yeah, I agree with that...
                                  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202108051325.175DPYG61303886%40masaka.moolenaar.net.

Raspunde prin e-mail lui