Patch 8.2.2934 (after 8.2.2933)
Problem:    ASAN error when using text from the clipboard.
Solution:   Get width of each character.
Files:      src/register.c


*** ../vim-8.2.2933/src/register.c      2021-06-04 17:11:44.516100707 +0200
--- src/register.c      2021-06-04 18:28:54.032714854 +0200
***************
*** 2908,2918 ****
        {
            charlen = 0;
            for (i = start; i < len; ++i)       // find the end of the line
                if (str[i] == '\n')
                    break;
            i -= start;                 // i is now length of line
-           if (start < len)
-               charlen = mb_charlen_len(str + start, i);
            if (charlen > maxlen)
                maxlen = charlen;
            if (append)
--- 2908,2919 ----
        {
            charlen = 0;
            for (i = start; i < len; ++i)       // find the end of the line
+           {
                if (str[i] == '\n')
                    break;
+               charlen += mb_ptr2cells_len(str + i, len - i);
+           }
            i -= start;                 // i is now length of line
            if (charlen > maxlen)
                maxlen = charlen;
            if (append)
***************
*** 2929,2935 ****
                mch_memmove(s, y_ptr->y_array[lnum], (size_t)extra);
            if (append)
                vim_free(y_ptr->y_array[lnum]);
!           if (i)
                mch_memmove(s + extra, str + start, (size_t)i);
            extra += i;
            s[extra] = NUL;
--- 2930,2936 ----
                mch_memmove(s, y_ptr->y_array[lnum], (size_t)extra);
            if (append)
                vim_free(y_ptr->y_array[lnum]);
!           if (i > 0)
                mch_memmove(s + extra, str + start, (size_t)i);
            extra += i;
            s[extra] = NUL;
*** ../vim-8.2.2933/src/version.c       2021-06-04 17:11:44.516100707 +0200
--- src/version.c       2021-06-04 18:32:06.936299140 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2934,
  /**/

-- 
<Beeth> Girls are like internet domain names,
        the ones I like are already taken.
<honx>  Well, you can stil get one from a strange country :-P

 /// 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/202106041634.154GYDpE3152253%40masaka.moolenaar.net.

Raspunde prin e-mail lui