From efa924f66b183d9cf2404ce91c4f009c27e0515a Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 18 Oct 2021 09:08:46 -0400 Subject: 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 --- src/nvim/os/shell.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/os/shell.c') diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index 2bff65b241..1399fc758c 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -159,7 +159,7 @@ int os_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file // get a name for the temp file if ((tempname = vim_tempname()) == NULL) { - EMSG(_(e_notmp)); + emsg(_(e_notmp)); return FAIL; } @@ -389,7 +389,7 @@ int os_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file os_remove((char *)tempname); if (readlen != len) { // unexpected read error - EMSG2(_(e_notread), tempname); + semsg(_(e_notread), tempname); xfree(tempname); xfree(buffer); return FAIL; @@ -1180,7 +1180,7 @@ static void shell_write_cb(Stream *stream, void *data, int status) if (status) { // Can happen if system() tries to send input to a shell command that was // backgrounded (:call system("cat - &", "foo")). #3529 #5241 - msg_schedule_emsgf(_("E5677: Error writing input to shell-command: %s"), + msg_schedule_semsg(_("E5677: Error writing input to shell-command: %s"), uv_err_name(status)); } stream_close(stream, NULL, NULL); -- cgit From e6ff154be6da8bd53b604fb6e38686acae75b24f Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 23 Oct 2021 16:04:37 -0400 Subject: vim-patch:8.1.0779: argument for message functions is inconsistent Problem: Argument for message functions is inconsistent. Solution: Make first argument to msg() "char *". https://github.com/vim/vim/commit/32526b3c1846025f0e655f41efd4e5428da16b6c --- src/nvim/os/shell.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/nvim/os/shell.c') diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index 1399fc758c..6ef0aa1091 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -341,7 +341,7 @@ int os_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file if (!(flags & EW_SILENT)) { msg_putchar('\n'); // clear bottom line quickly cmdline_row = Rows - 1; // continue on last line - MSG(_(e_wildexpand)); + msg(_(e_wildexpand)); msg_start(); // don't overwrite this message } @@ -358,7 +358,7 @@ int os_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file if (fd == NULL) { // Something went wrong, perhaps a file name with a special char. if (!(flags & EW_SILENT)) { - MSG(_(e_wildexpand)); + msg(_(e_wildexpand)); msg_start(); // don't overwrite this message } xfree(tempname); @@ -670,7 +670,7 @@ int os_call_shell(char_u *cmd, ShellOpts opts, char_u *extra_args) } if (!emsg_silent && exitcode != 0 && !(opts & kShellOptSilent)) { - MSG_PUTS(_("\nshell returned ")); + msg_puts(_("\nshell returned ")); msg_outnum(exitcode); msg_putchar('\n'); } @@ -742,9 +742,9 @@ static int do_os_system(char **argv, const char *input, size_t len, char **outpu loop_poll_events(&main_loop, 0); // Failed, probably 'shell' is not executable. if (!silent) { - MSG_PUTS(_("\nshell failed to start: ")); + msg_puts(_("\nshell failed to start: ")); msg_outtrans((char_u *)os_strerror(status)); - MSG_PUTS(": "); + msg_puts(": "); msg_outtrans((char_u *)prog); msg_putchar('\n'); } -- cgit