diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-05-26 20:59:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-26 20:59:28 +0200 |
commit | 1ca84897a0d65b0afbb2141f12a2061dabeb6b09 (patch) | |
tree | 01e8232cc8d79cf7dc03d66459d4d0bcaa4b077c /src/nvim/mbyte.c | |
parent | 0bbaef8a99af8733cc64ff29858e17c19ed30b3c (diff) | |
parent | 80f40f0203f5af167f8c77bf6b9f22a4d1abd6da (diff) | |
download | rneovim-1ca84897a0d65b0afbb2141f12a2061dabeb6b09.tar.gz rneovim-1ca84897a0d65b0afbb2141f12a2061dabeb6b09.tar.bz2 rneovim-1ca84897a0d65b0afbb2141f12a2061dabeb6b09.zip |
Merge #10059 from jerdna-regeiz/vim-8.1.0614
vim-patch:8.1.0614,8.1.0632,8.1.0644,8.1.0658,8.1.0660,8.1.0669,8.1.0673,8.1.0679,8.1.0697,8.1.0701,8.1.0702,8.1.0709,8.1.0717,8.1.0750,8.1.0767,8.1.0772,8.1.0039
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r-- | src/nvim/mbyte.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index c161bad66f..683087bd7b 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -2085,31 +2085,31 @@ static char_u *iconv_string(const vimconv_T *const vcp, char_u *str, to = (char *)result + done; tolen = len - done - 2; - /* Avoid a warning for systems with a wrong iconv() prototype by - * casting the second argument to void *. */ + // Avoid a warning for systems with a wrong iconv() prototype by + // casting the second argument to void *. if (iconv(vcp->vc_fd, (void *)&from, &fromlen, &to, &tolen) != SIZE_MAX) { - /* Finished, append a NUL. */ + // Finished, append a NUL. *to = NUL; break; } - /* Check both ICONV_EINVAL and EINVAL, because the dynamically loaded - * iconv library may use one of them. */ + // Check both ICONV_EINVAL and EINVAL, because the dynamically loaded + // iconv library may use one of them. if (!vcp->vc_fail && unconvlenp != NULL && (ICONV_ERRNO == ICONV_EINVAL || ICONV_ERRNO == EINVAL)) { - /* Handle an incomplete sequence at the end. */ + // Handle an incomplete sequence at the end. *to = NUL; *unconvlenp = fromlen; break; - } - /* Check both ICONV_EILSEQ and EILSEQ, because the dynamically loaded - * iconv library may use one of them. */ - else if (!vcp->vc_fail - && (ICONV_ERRNO == ICONV_EILSEQ || ICONV_ERRNO == EILSEQ - || ICONV_ERRNO == ICONV_EINVAL || ICONV_ERRNO == EINVAL)) { - /* Can't convert: insert a '?' and skip a character. This assumes - * conversion from 'encoding' to something else. In other - * situations we don't know what to skip anyway. */ + } else if (!vcp->vc_fail + && (ICONV_ERRNO == ICONV_EILSEQ || ICONV_ERRNO == EILSEQ + || ICONV_ERRNO == ICONV_EINVAL || ICONV_ERRNO == EINVAL)) { + // Check both ICONV_EILSEQ and EILSEQ, because the dynamically loaded + // iconv library may use one of them. + + // Can't convert: insert a '?' and skip a character. This assumes + // conversion from 'encoding' to something else. In other + // situations we don't know what to skip anyway. *to++ = '?'; if (utf_ptr2cells((char_u *)from) > 1) { *to++ = '?'; @@ -2122,7 +2122,7 @@ static char_u *iconv_string(const vimconv_T *const vcp, char_u *str, XFREE_CLEAR(result); break; } - /* Not enough room or skipping illegal sequence. */ + // Not enough room or skipping illegal sequence. done = to - (char *)result; } @@ -2132,11 +2132,9 @@ static char_u *iconv_string(const vimconv_T *const vcp, char_u *str, } # if defined(DYNAMIC_ICONV) -/* - * Dynamically load the "iconv.dll" on Win32. - */ +// Dynamically load the "iconv.dll" on Win32. -#ifndef DYNAMIC_ICONV /* just generating prototypes */ +#ifndef DYNAMIC_ICONV // just generating prototypes # define HINSTANCE int #endif static HINSTANCE hIconvDLL = 0; |