aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2026-02-05 13:36:27 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2026-02-05 13:36:27 +0100
commitfddd93edbdbf8c5afbfdb3c01d82e082a8a82d1a (patch)
treebc67c4cd3acea69333eb7bb4d8d4d904d5d6027a /editors
parent3d572a8cc3d71b43877db2776882e91303a0532d (diff)
downloadbusybox-w32-fddd93edbdbf8c5afbfdb3c01d82e082a8a82d1a.tar.gz
busybox-w32-fddd93edbdbf8c5afbfdb3c01d82e082a8a82d1a.tar.bz2
busybox-w32-fddd93edbdbf8c5afbfdb3c01d82e082a8a82d1a.zip
libbb: introduce and use xasprintf_inplace()
function old new delta xasprintf_and_free - 49 +49 watch_main 269 282 +13 singlemount 1313 1315 +2 append_mount_options 157 149 -8 ip_port_str 122 112 -10 lsblk_main 869 858 -11 add_cmd 1178 1167 -11 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/4 up/down: 64/-40) Total: 24 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors')
-rw-r--r--editors/sed.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 6179c5e80..029e9b8e7 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -657,9 +657,8 @@ static void add_cmd(const char *cmdstr)
657 657
658 /* Append this line to any unfinished line from last time. */ 658 /* Append this line to any unfinished line from last time. */
659 if (G.add_cmd_line) { 659 if (G.add_cmd_line) {
660 char *tp = xasprintf("%s\n%s", G.add_cmd_line, cmdstr); 660 cmdstr = xasprintf_inplace(G.add_cmd_line,
661 free(G.add_cmd_line); 661 "%s\n%s", G.add_cmd_line, cmdstr);
662 cmdstr = G.add_cmd_line = tp;
663 } 662 }
664 663
665 /* If this line ends with unescaped backslash, request next line. */ 664 /* If this line ends with unescaped backslash, request next line. */