diff options
author | Vladimir Azarov <avm@intermediate-node.net> | 2024-11-05 20:24:40 +0100 |
---|---|---|
committer | Vladimir Azarov <avm@intermediate-node.net> | 2024-11-05 21:49:55 +0100 |
commit | f777f6a9450d2bd5fc7ec531e6fb69f79942499a (patch) | |
tree | dc33cd941f49708274a74548862ba7b133013c55 /tools/sed.c | |
parent | 3972268b97b789a8212ea9bc7d1b9ce9905a68d8 (diff) |
Musl make
Diffstat (limited to 'tools/sed.c')
-rw-r--r-- | tools/sed.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/tools/sed.c b/tools/sed.c index fd60a07..c427acd 100644 --- a/tools/sed.c +++ b/tools/sed.c @@ -96,7 +96,6 @@ struct threadlist { struct ins *ref; struct node **presence_table; - }; struct input_buf { @@ -117,16 +116,6 @@ struct compiled_command { static struct compiled_command command_buf[max_commands]; static int command_num = 0; -static void error(char *fmt, ...) -{ - va_list vl; - va_start(vl, fmt); - evprintf(fmt, vl); - va_end(vl); - print_strz(&stderr, "\n"); - hexit(1); -} - static void inbuf_init() { input_buf.start = input_buf.end = input_buf.buf; @@ -818,6 +807,7 @@ static char **exec_threadlist(struct threadlist *clist, struct threadlist *nlist, char c, char *offset) { struct thread tmp; + struct thread tmp2; while (threadlist_getfront(clist, &tmp)) { start: switch(tmp.pc->opcode) { @@ -847,7 +837,7 @@ start: tmp.pc = tmp.pc->arg_labels[0]; goto start; case op_split: - struct thread tmp2 = thread_copy(&tmp); + tmp2 = thread_copy(&tmp); tmp2.pc = tmp.pc->arg_labels[1]; tmp.pc = tmp.pc->arg_labels[0]; threadlist_addfront(clist, tmp2); @@ -888,9 +878,9 @@ static char **__regex_exec(struct regex_prog *prog, struct str *str) static char **regex_exec(struct regex_prog *prog, struct str *str) { char **ret; - save_heap_offset(); + heap_offset_save(); ret = __regex_exec(prog, str); - restore_heap_offset(); + heap_offset_restore(); return ret; } |