1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-28 13:00:45 +00:00

Combine print_execp and print_exec as much as possible

This commit is contained in:
Nikolas Garofil 2010-02-11 01:08:25 +01:00
parent f0ed783041
commit 463836ebf9
2 changed files with 5 additions and 8 deletions

View File

@ -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);

View File

@ -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;