aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-07-30 14:09:35 -0400
committerJustin M. Keyes <justinkz@gmail.com>2016-07-30 15:28:13 -0400
commit02346f9bc7ab432931b059d075f16bfb09f93c1f (patch)
tree6c8a41e1b993f214b642fbfa440d75aa6b8a5255
parentf2d5ba65b54ff02cef438006d7dabd8de375fa33 (diff)
downloadrneovim-02346f9bc7ab432931b059d075f16bfb09f93c1f.tar.gz
rneovim-02346f9bc7ab432931b059d075f16bfb09f93c1f.tar.bz2
rneovim-02346f9bc7ab432931b059d075f16bfb09f93c1f.zip
os_resolve_shortcut: Report conversion error.
-rw-r--r--src/nvim/os/fs.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index 5a990cd042..cd943c4843 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -946,6 +946,7 @@ char_u * os_resolve_shortcut(char_u *fname)
OLECHAR wsz[MAX_PATH];
char_u *rfname = NULL;
int len;
+ int conversion_result;
IShellLinkW *pslw = NULL;
WIN32_FIND_DATAW ffdw;
@@ -966,8 +967,10 @@ char_u * os_resolve_shortcut(char_u *fname)
&IID_IShellLinkW, (void **)&pslw);
if (hr == S_OK) {
WCHAR *p;
- //TODO(jkeyes): if this returns non-zero, report the error
- (void)utf8_to_utf16((char *)fname, &p);
+ int conversion_result = utf8_to_utf16((char *)fname, &p);
+ if (conversion_result != 0) {
+ EMSG2("utf8_to_utf16 failed: %s", uv_strerror(conversion_result));
+ }
if (p != NULL) {
// Get a pointer to the IPersistFile interface.
@@ -994,8 +997,10 @@ char_u * os_resolve_shortcut(char_u *fname)
ZeroMemory(wsz, MAX_PATH * sizeof(WCHAR));
hr = pslw->lpVtbl->GetPath(pslw, wsz, MAX_PATH, &ffdw, 0);
if (hr == S_OK && wsz[0] != NUL) {
- //TODO(jkeyes): if this returns non-zero, report the error
- (void)utf16_to_utf8(wsz, &rfname);
+ int conversion_result = utf16_to_utf8(wsz, &rfname);
+ if (conversion_result != 0) {
+ EMSG2("utf16_to_utf8 failed: %s", uv_strerror(conversion_result));
+ }
}
shortcut_errorw: