aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/pty_process_win.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-08-15 09:32:18 +0200
committerGitHub <noreply@github.com>2019-08-15 09:32:18 +0200
commit6261d2658fdff93a732b02d8fd6e386245968f2d (patch)
tree3dd5de174ff4b0b555a49cff30937a2304b71857 /src/nvim/os/pty_process_win.c
parenteb9f3308bc329c212009820817d35c6ab7a88117 (diff)
parent975be7e5dcf6a2ee59a6fc236e75b434b6ce4423 (diff)
downloadrneovim-6261d2658fdff93a732b02d8fd6e386245968f2d.tar.gz
rneovim-6261d2658fdff93a732b02d8fd6e386245968f2d.tar.bz2
rneovim-6261d2658fdff93a732b02d8fd6e386245968f2d.zip
Merge #10761 from justinmk/win-utf-libuv-align
utf8_to_utf16, utf16_to_utf8: align with libuv
Diffstat (limited to 'src/nvim/os/pty_process_win.c')
-rw-r--r--src/nvim/os/pty_process_win.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/nvim/os/pty_process_win.c b/src/nvim/os/pty_process_win.c
index 290668bca3..183219bd3e 100644
--- a/src/nvim/os/pty_process_win.c
+++ b/src/nvim/os/pty_process_win.c
@@ -51,26 +51,26 @@ int pty_process_spawn(PtyProcess *ptyproc)
cfg = winpty_config_new(WINPTY_FLAG_ALLOW_CURPROC_DESKTOP_CREATION, &err);
if (cfg == NULL) {
- emsg = "Failed, winpty_config_new.";
+ emsg = "winpty_config_new failed";
goto cleanup;
}
winpty_config_set_initial_size(cfg, ptyproc->width, ptyproc->height);
winpty_object = winpty_open(cfg, &err);
if (winpty_object == NULL) {
- emsg = "Failed, winpty_open.";
+ emsg = "winpty_open failed";
goto cleanup;
}
- status = utf16_to_utf8(winpty_conin_name(winpty_object), &in_name);
+ status = utf16_to_utf8(winpty_conin_name(winpty_object), -1, &in_name);
if (status != 0) {
- emsg = "Failed to convert in_name from utf16 to utf8.";
+ emsg = "utf16_to_utf8(winpty_conin_name) failed";
goto cleanup;
}
- status = utf16_to_utf8(winpty_conout_name(winpty_object), &out_name);
+ status = utf16_to_utf8(winpty_conout_name(winpty_object), -1, &out_name);
if (status != 0) {
- emsg = "Failed to convert out_name from utf16 to utf8.";
+ emsg = "utf16_to_utf8(winpty_conout_name) failed";
goto cleanup;
}
@@ -93,9 +93,9 @@ int pty_process_spawn(PtyProcess *ptyproc)
}
if (proc->cwd != NULL) {
- status = utf8_to_utf16(proc->cwd, &cwd);
+ status = utf8_to_utf16(proc->cwd, -1, &cwd);
if (status != 0) {
- emsg = "Failed to convert pwd form utf8 to utf16.";
+ emsg = "utf8_to_utf16(proc->cwd) failed";
goto cleanup;
}
}
@@ -103,7 +103,7 @@ int pty_process_spawn(PtyProcess *ptyproc)
status = build_cmd_line(proc->argv, &cmd_line,
os_shell_is_cmdexe(proc->argv[0]));
if (status != 0) {
- emsg = "Failed to convert cmd line form utf8 to utf16.";
+ emsg = "build_cmd_line failed";
goto cleanup;
}
@@ -115,7 +115,7 @@ int pty_process_spawn(PtyProcess *ptyproc)
NULL, // Optional environment variables
&err);
if (spawncfg == NULL) {
- emsg = "Failed winpty_spawn_config_new.";
+ emsg = "winpty_spawn_config_new failed";
goto cleanup;
}
@@ -128,9 +128,9 @@ int pty_process_spawn(PtyProcess *ptyproc)
&err)) {
if (win_err) {
status = (int)win_err;
- emsg = "Failed spawn process.";
+ emsg = "failed to spawn process";
} else {
- emsg = "Failed winpty_spawn.";
+ emsg = "winpty_spawn failed";
}
goto cleanup;
}
@@ -160,11 +160,11 @@ int pty_process_spawn(PtyProcess *ptyproc)
cleanup:
if (status) {
// In the case of an error of MultiByteToWideChar or CreateProcessW.
- ELOG("%s error code: %d", emsg, status);
+ ELOG("pty_process_spawn: %s: error code: %d", emsg, status);
status = os_translate_sys_error(status);
} else if (err != NULL) {
status = (int)winpty_error_code(err);
- ELOG("%s error code: %d", emsg, status);
+ ELOG("pty_process_spawn: %s: error code: %d", emsg, status);
status = translate_winpty_error(status);
}
winpty_error_free(err);
@@ -308,7 +308,7 @@ static int build_cmd_line(char **argv, wchar_t **cmd_line, bool is_cmdexe)
}
}
- int result = utf8_to_utf16(utf8_cmd_line, cmd_line);
+ int result = utf8_to_utf16(utf8_cmd_line, -1, cmd_line);
xfree(utf8_cmd_line);
return result;
}