aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/env.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2021-10-18 09:08:46 -0400
committerJames McCoy <jamessan@jamessan.com>2021-11-01 06:41:28 -0400
commitefa924f66b183d9cf2404ce91c4f009c27e0515a (patch)
treeadc8c74cba88e76c2ae0548cd6e9b01804da9933 /src/nvim/os/env.c
parent684640f5518a483cf2bc48efc8f68449379cef69 (diff)
downloadrneovim-efa924f66b183d9cf2404ce91c4f009c27e0515a.tar.gz
rneovim-efa924f66b183d9cf2404ce91c4f009c27e0515a.tar.bz2
rneovim-efa924f66b183d9cf2404ce91c4f009c27e0515a.zip
vim-patch:8.1.0743: giving error messages is not flexible
Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts. https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
Diffstat (limited to 'src/nvim/os/env.c')
-rw-r--r--src/nvim/os/env.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index 0f363ecfc3..727b10f7a7 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -250,7 +250,7 @@ void os_copy_fullenv(char **env, size_t env_size)
char *utf8_str;
int conversion_result = utf16_to_utf8(p, -1, &utf8_str);
if (conversion_result != 0) {
- EMSG2("utf16_to_utf8 failed: %d", conversion_result);
+ semsg("utf16_to_utf8 failed: %d", conversion_result);
break;
}
p += l + 1;
@@ -297,7 +297,7 @@ char *os_getenvname_at_index(size_t index)
char *utf8_str;
int conversion_result = utf16_to_utf8(p, -1, &utf8_str);
if (conversion_result != 0) {
- EMSG2("utf16_to_utf8 failed: %d", conversion_result);
+ semsg("utf16_to_utf8 failed: %d", conversion_result);
break;
}
@@ -375,7 +375,7 @@ void os_get_hostname(char *hostname, size_t size)
if (GetComputerNameW(host_utf16, &host_wsize) == 0) {
*hostname = '\0';
DWORD err = GetLastError();
- EMSG2("GetComputerNameW failed: %d", err);
+ semsg("GetComputerNameW failed: %d", err);
return;
}
host_utf16[host_wsize] = '\0';
@@ -383,13 +383,13 @@ void os_get_hostname(char *hostname, size_t size)
char *host_utf8;
int conversion_result = utf16_to_utf8(host_utf16, -1, &host_utf8);
if (conversion_result != 0) {
- EMSG2("utf16_to_utf8 failed: %d", conversion_result);
+ semsg("utf16_to_utf8 failed: %d", conversion_result);
return;
}
xstrlcpy(hostname, host_utf8, size);
xfree(host_utf8);
#else
- EMSG("os_get_hostname failed: missing uname()");
+ emsg("os_get_hostname failed: missing uname()");
*hostname = '\0';
#endif
}
@@ -481,7 +481,7 @@ void init_homedir(void)
var = (char *)IObuff;
}
if (os_chdir(os_buf) != 0) {
- EMSG(_(e_prev_dir));
+ emsg(_(e_prev_dir));
}
}
}