aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2026-02-06 11:19:11 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2026-02-06 11:19:11 +0100
commit9b2a50efe227048e3d5029148619d5cc5ad089be (patch)
tree37d757a8cefd52810093e7454a324932123ee9e3 /shell
parent89f37ebe8c7f2ebdd7a623cccf1860dc4ab7b0b7 (diff)
downloadbusybox-w32-9b2a50efe227048e3d5029148619d5cc5ad089be.tar.gz
busybox-w32-9b2a50efe227048e3d5029148619d5cc5ad089be.tar.bz2
busybox-w32-9b2a50efe227048e3d5029148619d5cc5ad089be.zip
*: use xasprintf_inplace() in more places
function old new delta .rodata 107009 107018 +9 parse_stream 3075 3069 -6 buffer_print 612 603 -9 expand_args 159 144 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 9/-30) Total: -21 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/shell/hush.c b/shell/hush.c
index da0db7948..23e7f512f 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2941,12 +2941,9 @@ static void i_prepend_to_alias_buffer(struct in_str *i, char *prepend, char ch)
2941 * a 2941 * a
2942 * ^^^ runs "echo A: c" 2942 * ^^^ runs "echo A: c"
2943 */ 2943 */
2944 char *old = i->albuf;
2945 //bb_error_msg("before'%s' p'%s'", i->albuf, i->p); 2944 //bb_error_msg("before'%s' p'%s'", i->albuf, i->p);
2946 i->albuf = xasprintf("%s%c%s", prepend, ch, i->p); 2945 i->p = xasprintf_inplace(i->albuf, "%s%c%s", prepend, ch, i->p);
2947 i->p = i->albuf;
2948 //bb_error_msg("after'%s' p'%s'", i->albuf, i->p); 2946 //bb_error_msg("after'%s' p'%s'", i->albuf, i->p);
2949 free(old);
2950 return; 2947 return;
2951 } 2948 }
2952 i->saved_ibuf = i->p; 2949 i->saved_ibuf = i->p;