busybox/editors
Ron Yorston 26895db35d ed: fix line insertion before current line. Closes 15081
When text is inserted by insertLine() the lines following the
insertion are moved down and the insertion point is made the new
current line.  To avoid too much scanning of the linked list of
lines setCurNum() may use the position of the old current line to
determine the location of the new current line.

If the insertion point is before the old current line in the file
the latter will have been moved down, so its line pointer needs to
be adjusted.

function                                             old     new   delta
insertLine                                           162     180     +18
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 18/0)               Total: 18 bytes

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-09-27 20:14:04 +02:00
..
awk.c awk: mktime() with no arguments is not allowed 2024-07-10 07:04:28 +02:00
cmp.c Update applet size estimates 2023-07-10 17:25:21 +02:00
Config.src restore documentation on the build config language 2018-06-06 15:16:48 +02:00
diff.c diff: code shrink 2021-02-22 19:00:07 +01:00
ed.c ed: fix line insertion before current line. Closes 15081 2024-09-27 20:14:04 +02:00
Kbuild.src switch editors/* to embedded-in-source kbuild system 2013-11-13 12:45:33 +01:00
patch_bbox.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
patch_toybox.c Update applet size estimates 2023-07-10 17:25:21 +02:00
patch.c Update applet size estimates 2023-07-10 17:25:21 +02:00
sed1line.txt add sed mini-doc 2007-11-13 17:13:31 +00:00
sed_summary.htm doc: add info about sed s/.../.../I modifier 2008-03-01 19:29:56 +00:00
sed.c sed: check errors writing file with sed -i 2024-01-02 00:58:56 +01:00
vi.c vi: Ensure that the edit buffer ends in a newline 2024-07-11 17:52:18 +02:00