openbsd-ports/x11/ratpoison/patches/patch-src_editor_c
naddy eba19c9b08 Fix an index bug and update HOMEPAGE and MASTERSITES.
From: Matthias Kilian <kili@outback.escape.de>
2005-11-13 13:19:23 +00:00

13 lines
535 B
Plaintext

$OpenBSD: patch-src_editor_c,v 1.1 2005/11/13 13:19:23 naddy Exp $
--- src/editor.c.orig Fri Feb 27 08:26:03 2004
+++ src/editor.c Wed Nov 9 19:50:46 2005
@@ -406,7 +406,7 @@ editor_insert (rp_input_line *line, char
line->buffer = xrealloc (line->buffer, line->size);
}
- for (i = line->length + nbytes; i > line->position; i--)
+ for (i = line->length + nbytes; i > line->position && i >= nbytes; i--)
line->buffer[i] = line->buffer[i - nbytes];
strncpy (&line->buffer[line->position], keysym_buf, nbytes);