mawww/kakoune — pull request #40 by ashleyh (2014-01-23 16:51:40+00:00)
Title: prevent infinite recursion in on_assert_failed

While playing with kakoune I found that `kak -h` segfaults. It turns out to be because:

- the `-h` causes an `assert` to fail
- `on_assert_failed` tries to write to a debug buffer
- it's not possible to create a debug buffer because kakoune isn't initialised yet, so another `assert` fails
- `on_assert_failed` gets called again
- `kak` goes into an infinite recursion and runs out of stack space.

Here's a fix.