diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-08-13 05:47:58 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-08-15 00:28:41 +0200 |
commit | 8727f7a6a4ef10ce7536fbc003ef13b768f1aa91 (patch) | |
tree | 8b577b3e7b8e997341bbad3747dd19f7015da216 /src/nvim/os/fs.c | |
parent | fc60d92795d20f3f3c498b97aae5e46a71cafa8d (diff) | |
download | rneovim-8727f7a6a4ef10ce7536fbc003ef13b768f1aa91.tar.gz rneovim-8727f7a6a4ef10ce7536fbc003ef13b768f1aa91.tar.bz2 rneovim-8727f7a6a4ef10ce7536fbc003ef13b768f1aa91.zip |
utf8_to_utf16: align with libuv
- take a size parameter
- always NUL-terminate the result
- return libuv error code
- handle error in caller only (avoid redundant messages)
https://github.com/libuv/libuv/commit/53995a3825d23eacd01e2bcfa35642c4a188d32b
https://github.com/libuv/libuv/commit/4c945f49365ab4d6e1b07bf0ef2893455dc04622
Diffstat (limited to 'src/nvim/os/fs.c')
-rw-r--r-- | src/nvim/os/fs.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index dcb3ef7c4a..615ab143b2 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -1180,12 +1180,10 @@ char *os_resolve_shortcut(const char *fname) &IID_IShellLinkW, (void **)&pslw); if (hr == S_OK) { wchar_t *p; - const int conversion_result = utf8_to_utf16(fname, &p); + const int conversion_result = utf8_to_utf16(fname, len, &p); if (conversion_result != 0) { EMSG2("utf8_to_utf16 failed: %d", conversion_result); - } - - if (p != NULL) { + } else if (p != NULL) { // Get a pointer to the IPersistFile interface. hr = pslw->lpVtbl->QueryInterface( pslw, &IID_IPersistFile, (void **)&ppf); |