aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r--src/nvim/main.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index c329c9a8f4..921bc883cf 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -674,8 +674,7 @@ void getout(int exitval)
profile_dump();
- if (did_emsg
- ) {
+ if (did_emsg) {
// give the user a chance to read the (error) message
no_wait_return = FALSE;
wait_return(FALSE);
@@ -824,11 +823,11 @@ static void command_line_scan(mparm_T *parmp)
msgpack_packer *p = msgpack_packer_new(&fp, msgpack_file_write);
if (fof_ret != 0) {
- emsgf(_("E5421: Failed to open stdin: %s"), os_strerror(fof_ret));
+ semsg(_("E5421: Failed to open stdin: %s"), os_strerror(fof_ret));
}
if (p == NULL) {
- EMSG(_(e_outofmem));
+ emsg(_(e_outofmem));
}
Object md = DICTIONARY_OBJ(api_metadata());
@@ -1698,8 +1697,11 @@ static void do_system_initialization(void)
}
char *vimrc = xmalloc(dir_len + sizeof(path_tail) + 1);
memcpy(vimrc, dir, dir_len);
- vimrc[dir_len] = PATHSEP;
- memcpy(vimrc + dir_len + 1, path_tail, sizeof(path_tail));
+ if (vimrc[dir_len - 1] != PATHSEP) {
+ vimrc[dir_len] = PATHSEP;
+ dir_len += 1;
+ }
+ memcpy(vimrc + dir_len, path_tail, sizeof(path_tail));
if (do_source(vimrc, false, DOSO_NONE) != FAIL) {
xfree(vimrc);
xfree(config_dirs);
@@ -1743,7 +1745,7 @@ static bool do_user_initialization(void)
if (os_path_exists(init_lua_path)
&& do_source((char *)init_lua_path, true, DOSO_VIMRC)) {
if (os_path_exists(user_vimrc)) {
- EMSG3(_("E5422: Conflicting configs: \"%s\" \"%s\""), init_lua_path,
+ semsg(_("E5422: Conflicting configs: \"%s\" \"%s\""), init_lua_path,
user_vimrc);
}
@@ -1815,7 +1817,7 @@ static void source_startup_scripts(const mparm_T *const parmp)
// Do nothing.
} else {
if (do_source(parmp->use_vimrc, false, DOSO_NONE) != OK) {
- EMSG2(_("E282: Cannot read from \"%s\""), parmp->use_vimrc);
+ semsg(_("E282: Cannot read from \"%s\""), parmp->use_vimrc);
}
}
} else if (!silent_mode) {