From 0ee557a4eee3a4b406fff3353012c470ea59eef6 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Sat, 20 Nov 2010 16:59:32 +0100 Subject: [PATCH] Fix bug with SF ID 3101185 --- src/common.cc | 5 +---- src/core.cc | 4 ++++ src/exec.cc | 4 +--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/common.cc b/src/common.cc index 4491707c..0cead0a2 100644 --- a/src/common.cc +++ b/src/common.cc @@ -460,12 +460,9 @@ void print_loadavg(struct text_object *obj, char *p, int p_max_size) void scan_no_update(struct text_object *obj, const char *arg) { - struct text_object subroot; - obj->data.s = (char*) malloc(text_buffer_size); - parse_conky_vars(&subroot, arg, obj->data.s, text_buffer_size); + evaluate(arg, obj->data.s, text_buffer_size); obj->data.s = (char*) realloc(obj->data.s, strlen(obj->data.s) + 1); - free_text_objects(&subroot); } void free_no_update(struct text_object *obj) { diff --git a/src/core.cc b/src/core.cc index 8a1ce834..bfbf36bb 100644 --- a/src/core.cc +++ b/src/core.cc @@ -724,6 +724,7 @@ struct text_object *construct_text_object(char *s, const char *arg, long END OBJ(execp, 0) scan_exec_arg(obj, arg); obj->parse = true; + obj->verbatim_output = true; obj->thread = false; obj->callbacks.print = &print_exec; obj->callbacks.free = &free_exec; @@ -764,6 +765,7 @@ struct text_object *construct_text_object(char *s, const char *arg, long END OBJ_ARG(execpi, 0, "execpi needs arguments") scan_execi_arg(obj, arg); obj->parse = true; + obj->verbatim_output = true; obj->thread = false; obj->callbacks.print = &print_execi; obj->callbacks.free = &free_execi; @@ -776,6 +778,7 @@ struct text_object *construct_text_object(char *s, const char *arg, long END OBJ_ARG(texecpi, 0, "texecpi needs arguments") scan_execi_arg(obj, arg); obj->parse = true; + obj->verbatim_output = true; obj->thread = true; obj->callbacks.print = &print_execi; obj->callbacks.free = &free_execi; @@ -1635,6 +1638,7 @@ struct text_object *construct_text_object(char *s, const char *arg, long obj->callbacks.free = &gen_free_opaque; END OBJ_ARG(lua_parse, 0, "lua_parse needs arguments: [function parameters]") obj->data.s = strndup(arg, text_buffer_size); + obj->verbatim_output = true; obj->callbacks.print = &print_lua_parse; obj->callbacks.free = &gen_free_opaque; END OBJ_ARG(lua_bar, 0, "lua_bar needs arguments: , [function parameters]") diff --git a/src/exec.cc b/src/exec.cc index 076774df..757e22c0 100644 --- a/src/exec.cc +++ b/src/exec.cc @@ -290,9 +290,7 @@ void scan_execgraph_arg(struct text_object *obj, const char *arg) void fill_p(char *buffer, struct text_object *obj, char *p, int p_max_size) { if(obj->parse == true) { - struct text_object subroot; - parse_conky_vars(&subroot, buffer, p, p_max_size); - free_text_objects(&subroot); + evaluate(buffer, p, p_max_size); } else snprintf(p, p_max_size, "%s", buffer); remove_deleted_chars(p); }