summaryrefslogtreecommitdiff
path: root/tools/sed.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/sed.c')
-rw-r--r--tools/sed.c18
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;
}