1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-16 18:15:17 +00:00

Combine print_texeci and print_texecpi as much as possible

This commit is contained in:
Nikolas Garofil 2010-02-10 15:21:00 +01:00
parent 456142241c
commit e017870b58
2 changed files with 7 additions and 11 deletions

View File

@ -632,7 +632,8 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->callbacks.free = &free_execi;
END OBJ_ARG(texecpi, 0, "texecpi needs arguments")
scan_execi_arg(obj, arg);
obj->callbacks.print = &print_texecpi;
obj->parse = true;
obj->callbacks.print = &print_texeci;
obj->callbacks.free = &free_execi;
END OBJ(pre_exec, 0)
scan_pre_exec_arg(obj, arg);

View File

@ -356,17 +356,12 @@ void print_texeci(struct text_object *obj, char *p, int p_max_size)
{
char* buffer = threaded_exec_caller(obj);
if(buffer != NULL) snprintf(p, p_max_size, "%s", buffer);
}
void print_texecpi(struct text_object *obj, char *p, int p_max_size)
{
char* buffer = threaded_exec_caller(obj);
struct text_object subroot;
if(buffer != NULL) {
parse_conky_vars(&subroot, buffer, p, p_max_size);
free_text_objects(&subroot);
if(obj->parse == true) {
struct text_object subroot;
parse_conky_vars(&subroot, buffer, p, p_max_size);
free_text_objects(&subroot);
} else snprintf(p, p_max_size, "%s", buffer);
}
}