diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-10-25 15:33:57 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-10-25 15:55:29 +0200 |
commit | e8ddbbdf07838a99545181a5f63d460f4ea7e8a4 (patch) | |
tree | f05ea387861273f79bc8ddec6c9892a503e64f49 /src | |
parent | c853fd6fab212688c71d66c869e48401ac155973 (diff) | |
download | rneovim-e8ddbbdf07838a99545181a5f63d460f4ea7e8a4.tar.gz rneovim-e8ddbbdf07838a99545181a5f63d460f4ea7e8a4.tar.bz2 rneovim-e8ddbbdf07838a99545181a5f63d460f4ea7e8a4.zip |
list_features(): Hack around infinite loop.
msg_putchar() is not updating msg_col, this causes an infinite loop. Observed
with execute('version') *nested* in another execute(), in particular this line:
let buildtype = matchstr(execute('version'), '\v\cbuild type:?\s*[^\n\r\t ]+')
when called by :CheckHealth (see runtime/autoload/health/nvim ..
s:check_performance()).
But invoking some variation of execute('...execute("version")') is not enough to
provoke the bug, maybe it needs to be in a user function?
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/version.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/version.c b/src/nvim/version.c index 6b9c8bf6b1..54f03cd3dd 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -2570,7 +2570,11 @@ static void list_features(void) } } else { while (msg_col % width) { + int old_msg_col = msg_col; msg_putchar(' '); + if (old_msg_col == msg_col) { + break; // XXX: Avoid infinite loop. + } } } } else { |