From 463836ebf9f47df31d22a3c2af6fc677cdb973b5 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Thu, 11 Feb 2010 01:08:25 +0100 Subject: [PATCH] Combine print_execp and print_exec as much as possible --- src/core.cc | 5 ++++- src/exec.cc | 8 +------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/core.cc b/src/core.cc index 28888131..f854edd0 100644 --- a/src/core.cc +++ b/src/core.cc @@ -581,13 +581,16 @@ struct text_object *construct_text_object(const char *s, const char *arg, long #endif /* BUILD_IMLIB2 */ END OBJ(exec, 0) scan_exec_arg(obj, arg); + obj->parse = false; + obj->thread = false; obj->callbacks.print = &print_exec; obj->callbacks.free = &free_exec; END OBJ(execp, 0) scan_exec_arg(obj, arg); obj->verbatim_output = 1; obj->parse = true; - obj->callbacks.print = &print_execp; + obj->thread = false; + obj->callbacks.print = &print_exec; obj->callbacks.free = &free_exec; END OBJ(execbar, 0) scan_exec_arg(obj, arg); diff --git a/src/exec.cc b/src/exec.cc index 31eb3a28..46aba1c7 100644 --- a/src/exec.cc +++ b/src/exec.cc @@ -289,12 +289,6 @@ void scan_execgraph_arg(struct text_object *obj, const char *arg) } #endif /* BUILD_X11 */ -void print_exec(struct text_object *obj, char *p, int p_max_size) -{ - read_exec(obj->data.s, p, p_max_size); - remove_deleted_chars(p); -} - void fill_p(char *buffer, struct text_object *obj, char *p, int p_max_size) { if(obj->parse == true) { struct text_object subroot; @@ -304,7 +298,7 @@ void fill_p(char *buffer, struct text_object *obj, char *p, int p_max_size) { remove_deleted_chars(p); } -void print_execp(struct text_object *obj, char *p, int p_max_size) +void print_exec(struct text_object *obj, char *p, int p_max_size) { char *buf;