diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-02-22 13:42:07 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-02-22 13:42:07 +0100 |
commit | 97c2c05ead689f4a5de986c82531fcbd09295cda (patch) | |
tree | 50375633d0f13ead227f2cbfd1dc4a4dc61efeb7 /src/message.c | |
parent | 527a2d86fb375fcc7b34e80fc47f4c7126fc12ba (diff) | |
download | vim-git-97c2c05ead689f4a5de986c82531fcbd09295cda.tar.gz |
patch 8.1.0969: message written during startup is truncatedv8.1.0969
Problem: Message written during startup is truncated.
Solution: Restore message after truncating. (closes 3969)
Diffstat (limited to 'src/message.c')
-rw-r--r-- | src/message.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/message.c b/src/message.c index a7aca2b99..d6acb0991 100644 --- a/src/message.c +++ b/src/message.c @@ -2627,12 +2627,19 @@ msg_puts_printf(char_u *str, int maxlen) if (*p != NUL && !(silent_mode && p_verbose == 0)) { + int c = -1; + if (maxlen > 0 && STRLEN(p) > (size_t)maxlen) + { + c = p[maxlen]; p[maxlen] = 0; + } if (info_message) mch_msg((char *)p); else mch_errmsg((char *)p); + if (c != -1) + p[maxlen] = c; } msg_didout = TRUE; // assume that line is not empty |