diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-10-27 12:27:10 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-10-27 12:27:10 +0100 |
| commit | ab227e12694f7fea3c64d93d87e24f017fca65a5 (patch) | |
| tree | 639d5cdc1aa831a5293769bf00142a19dc9013a2 | |
| parent | a99e1540c389d6c716bfd5bb8c407831d5138651 (diff) | |
| download | vis-ab227e12694f7fea3c64d93d87e24f017fca65a5.tar.gz vis-ab227e12694f7fea3c64d93d87e24f017fca65a5.tar.xz | |
Fix segfault when joining lines
| -rw-r--r-- | vis.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -650,7 +650,7 @@ static void op_join(OperatorContext *c) { prev_pos = pos; size_t end = text_line_start(txt, pos); pos = text_char_next(txt, text_line_finish(txt, text_line_prev(txt, end))); - if (pos > c->range.start) { + if (pos > c->range.start && end > pos) { text_delete(txt, pos, end - pos); text_insert(txt, pos, " ", 1); } else { |
