summaryrefslogtreecommitdiffstats
path: root/source/ap/vim/patches/7.2.244
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2009-08-26 10:00:38 -0500
committer Eric Hameleers <alien@slackware.com>2018-05-31 22:41:17 +0200
commit5a12e7c134274dba706667107d10d231517d3e05 (patch)
tree55718d5acb710fde798d9f38d0bbaf594ed4b296 /source/ap/vim/patches/7.2.244
downloadcurrent-5a12e7c134274dba706667107d10d231517d3e05.tar.gz
current-5a12e7c134274dba706667107d10d231517d3e05.tar.xz
Slackware 13.0slackware-13.0
Wed Aug 26 10:00:38 CDT 2009 Slackware 13.0 x86_64 is released as stable! Thanks to everyone who helped make this release possible -- see the RELEASE_NOTES for the credits. The ISOs are off to the replicator. This time it will be a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. We're taking pre-orders now at store.slackware.com. Please consider picking up a copy to help support the project. Once again, thanks to the entire Slackware community for all the help testing and fixing things and offering suggestions during this development cycle. As always, have fun and enjoy! -P.
Diffstat (limited to 'source/ap/vim/patches/7.2.244')
-rw-r--r--source/ap/vim/patches/7.2.244174
1 files changed, 174 insertions, 0 deletions
diff --git a/source/ap/vim/patches/7.2.244 b/source/ap/vim/patches/7.2.244
new file mode 100644
index 000000000..6c9b1fb80
--- /dev/null
+++ b/source/ap/vim/patches/7.2.244
@@ -0,0 +1,174 @@
+To: vim-dev@vim.org
+Subject: Patch 7.2.244
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.244
+Problem: When 'enc' is utf-8 and 'fenc' is latin1, writing a non-latin1
+ character gives a conversion error without any hint what is wrong.
+Solution: When known add the line number to the error message.
+Files: src/fileio.c
+
+
+*** ../vim-7.2.243/src/fileio.c 2009-07-29 12:09:49.000000000 +0200
+--- src/fileio.c 2009-07-29 17:04:06.000000000 +0200
+***************
+*** 121,126 ****
+--- 121,128 ----
+ char_u *bw_conv_buf; /* buffer for writing converted chars */
+ int bw_conv_buflen; /* size of bw_conv_buf */
+ int bw_conv_error; /* set for conversion error */
++ linenr_T bw_conv_error_lnum; /* first line with error or zero */
++ linenr_T bw_start_lnum; /* line number at start of buffer */
+ # ifdef USE_ICONV
+ iconv_t bw_iconv_fd; /* descriptor for iconv() or -1 */
+ # endif
+***************
+*** 2924,2929 ****
+--- 2925,2931 ----
+ linenr_T lnum;
+ long nchars;
+ char_u *errmsg = NULL;
++ int errmsg_allocated = FALSE;
+ char_u *errnum = NULL;
+ char_u *buffer;
+ char_u smallbuf[SMBUFSIZE];
+***************
+*** 2987,2992 ****
+--- 2989,2995 ----
+ /* must init bw_conv_buf and bw_iconv_fd before jumping to "fail" */
+ write_info.bw_conv_buf = NULL;
+ write_info.bw_conv_error = FALSE;
++ write_info.bw_conv_error_lnum = 0;
+ write_info.bw_restlen = 0;
+ # ifdef USE_ICONV
+ write_info.bw_iconv_fd = (iconv_t)-1;
+***************
+*** 4243,4248 ****
+--- 4245,4251 ----
+ nchars += write_info.bw_len;
+ }
+ }
++ write_info.bw_start_lnum = start;
+ #endif
+
+ write_info.bw_len = bufsize;
+***************
+*** 4278,4283 ****
+--- 4281,4289 ----
+ nchars += bufsize;
+ s = buffer;
+ len = 0;
++ #ifdef FEAT_MBYTE
++ write_info.bw_start_lnum = lnum;
++ #endif
+ }
+ /* write failed or last line has no EOL: stop here */
+ if (end == 0
+***************
+*** 4474,4480 ****
+ {
+ #ifdef FEAT_MBYTE
+ if (write_info.bw_conv_error)
+! errmsg = (char_u *)_("E513: write error, conversion failed (make 'fenc' empty to override)");
+ else
+ #endif
+ if (got_int)
+--- 4480,4496 ----
+ {
+ #ifdef FEAT_MBYTE
+ if (write_info.bw_conv_error)
+! {
+! if (write_info.bw_conv_error_lnum == 0)
+! errmsg = (char_u *)_("E513: write error, conversion failed (make 'fenc' empty to override)");
+! else
+! {
+! errmsg_allocated = TRUE;
+! errmsg = alloc(300);
+! vim_snprintf((char *)errmsg, 300, _("E513: write error, conversion failed in line %ld (make 'fenc' empty to override)"),
+! (long)write_info.bw_conv_error_lnum);
+! }
+! }
+ else
+ #endif
+ if (got_int)
+***************
+*** 4550,4555 ****
+--- 4566,4577 ----
+ {
+ STRCAT(IObuff, _(" CONVERSION ERROR"));
+ c = TRUE;
++ if (write_info.bw_conv_error_lnum != 0)
++ {
++ int l = STRLEN(IObuff);
++ vim_snprintf((char *)IObuff + l, IOSIZE - l, _(" in line %ld;"),
++ (long)write_info.bw_conv_error_lnum);
++ }
+ }
+ else if (notconverted)
+ {
+***************
+*** 4746,4751 ****
+--- 4768,4775 ----
+ }
+ STRCAT(IObuff, errmsg);
+ emsg(IObuff);
++ if (errmsg_allocated)
++ vim_free(errmsg);
+
+ retval = FAIL;
+ if (end == 0)
+***************
+*** 5105,5111 ****
+ c = buf[wlen];
+ }
+
+! ip->bw_conv_error |= ucs2bytes(c, &p, flags);
+ }
+ if (flags & FIO_LATIN1)
+ len = (int)(p - buf);
+--- 5129,5141 ----
+ c = buf[wlen];
+ }
+
+! if (ucs2bytes(c, &p, flags) && !ip->bw_conv_error)
+! {
+! ip->bw_conv_error = TRUE;
+! ip->bw_conv_error_lnum = ip->bw_start_lnum;
+! }
+! if (c == NL)
+! ++ip->bw_start_lnum;
+ }
+ if (flags & FIO_LATIN1)
+ len = (int)(p - buf);
+***************
+*** 5386,5391 ****
+--- 5416,5422 ----
+ #ifdef FEAT_MBYTE
+ /*
+ * Convert a Unicode character to bytes.
++ * Return TRUE for an error, FALSE when it's OK.
+ */
+ static int
+ ucs2bytes(c, pp, flags)
+*** ../vim-7.2.243/src/version.c 2009-07-29 16:13:35.000000000 +0200
+--- src/version.c 2009-07-29 18:01:27.000000000 +0200
+***************
+*** 678,679 ****
+--- 678,681 ----
+ { /* Add new patch number below this line */
++ /**/
++ 244,
+ /**/
+
+--
+Support your right to bare arms! Wear short sleeves!
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///