aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-01-21 16:04:10 +0000
committerRon Yorston <rmy@pobox.com>2020-01-21 16:04:10 +0000
commitf860ce1fdbbbeb1334e11969f609d81f3d2b6724 (patch)
tree895864fb6f15b956933404b0554594b6b29dbb15
parentb8e04d0b842c77047bc59edc5b369e3f5a745d0a (diff)
downloadbusybox-w32-f860ce1fdbbbeb1334e11969f609d81f3d2b6724.tar.gz
busybox-w32-f860ce1fdbbbeb1334e11969f609d81f3d2b6724.tar.bz2
busybox-w32-f860ce1fdbbbeb1334e11969f609d81f3d2b6724.zip
ash: tidy up history_copy()
No change in functionality or executable size.
-rw-r--r--shell/ash.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 9a42b9d78..0d59b4864 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -15760,16 +15760,16 @@ history_size(struct datasize ds, line_input_t *st)
15760static char ** 15760static char **
15761history_copy(line_input_t *st) 15761history_copy(line_input_t *st)
15762{ 15762{
15763 char **new, **start = funcblock; 15763 char **new = funcblock;
15764 int i; 15764 int i;
15765 15765
15766 funcblock = (char *)funcblock + sizeof(char *) * st->cnt_history;
15766 for (i = 0; i < st->cnt_history; i++) { 15767 for (i = 0; i < st->cnt_history; i++) {
15767 new = funcblock; 15768 new[i] = nodeckstrdup(st->history[i]);
15768 funcblock = (char *) funcblock + sizeof(char *); 15769 SAVE_PTR(new[i],
15769 *new = nodeckstrdup(st->history[i]); 15770 xasprintf("history[%d] '%s'", i, st->history[i]), FREE);
15770 SAVE_PTR(*new, xasprintf("history[%d] '%s'", i, st->history[i]), FREE);
15771 } 15771 }
15772 return start; 15772 return new;
15773} 15773}
15774#endif 15774#endif
15775 15775