To: vim-dev@vim.org Subject: Patch 6.0.074 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.0.074 Problem: When using "&" in a substitute string a multi-byte character with a trailbyte 0x5c is not handled correctly. Solution: Recognize multi-byte characters inside the "&" part. (Muraoka Taro) Files: src/regexp.c *** ../vim60.73/src/regexp.c Wed Oct 31 15:17:54 2001 --- src/regexp.c Mon Nov 5 08:46:11 2001 *************** *** 5403,5408 **** --- 5403,5412 ---- #ifdef FEAT_EVAL static char_u *eval_result = NULL; #endif + #ifdef FEAT_MBYTE + int l; + #endif + /* Be paranoid... */ if (source == NULL || dest == NULL) *************** *** 5482,5491 **** } if (no < 0) /* Ordinary character. */ { - #ifdef FEAT_MBYTE - int l; - #endif - if (c == '\\' && *src != NUL) { /* Check for abbreviations -- webb */ --- 5486,5491 ---- *************** *** 5606,5611 **** --- 5606,5622 ---- } dst += 2; } + #ifdef FEAT_MBYTE + else if (has_mbyte && (l = (*mb_ptr2len_check)(s)) > 1) + { + /* TODO: should use "func" here. */ + if (copy) + mch_memmove(dst, s, l); + dst += l; + s += l - 1; + len -= l - 1; + } + #endif else { if (copy) *** ../vim60.73/src/version.c Mon Nov 5 08:51:05 2001 --- src/version.c Mon Nov 5 08:50:40 2001 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 74, /**/ -- Engineers understand that their appearance only bothers other people and therefore it is not worth optimizing. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim ))) \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///