diff --git a/src/conky.cc b/src/conky.cc index c2b65edb..16eef1e4 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -788,7 +788,8 @@ void generate_text_internal(char *p, int p_max_size, struct text_object root) #ifdef BUILD_ICONV iconv_convert(&a, buff_in, p, p_max_size); #endif /* BUILD_ICONV */ - substitute_newlines(p, a - 2); + if (!obj->verbatim_output) + substitute_newlines(p, a - 2); p += a; p_max_size -= a; (*p) = 0; diff --git a/src/text_object.cc b/src/text_object.cc index 4663451d..efb6dd4d 100644 --- a/src/text_object.cc +++ b/src/text_object.cc @@ -197,6 +197,7 @@ int ifblock_stack_empty(void **opaque) void obj_be_plain_text(struct text_object *obj, const char *text) { obj->data.s = strdup(text); + obj->verbatim_output = 1; memset(&obj->callbacks, 0, sizeof(obj->callbacks)); obj->callbacks.print = &gen_print_obj_data_s; diff --git a/src/text_object.h b/src/text_object.h index 8681160e..d1c958f7 100644 --- a/src/text_object.h +++ b/src/text_object.h @@ -85,6 +85,9 @@ struct text_object { long l; /* some long integer */ } data; + /* if non-zero, no substitute_newlines() is applied to object's output */ + char verbatim_output; + void *special_data; long line; struct obj_cb callbacks;