mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-26 04:17:33 +00:00
misc.cc: Evaluate the result and then parse it to capitalize
This commit is contained in:
parent
f2ca86cca0
commit
5980fb4a52
@ -845,10 +845,9 @@ struct text_object *construct_text_object(char *s, const char *arg, long line,
|
|||||||
END OBJ(freq2, 0) obj->callbacks.print = &print_freq2;
|
END OBJ(freq2, 0) obj->callbacks.print = &print_freq2;
|
||||||
#endif /* __x86_64__ */
|
#endif /* __x86_64__ */
|
||||||
|
|
||||||
END OBJ(cap, 0) obj->data.s = STRNDUP_ARG;
|
END OBJ(start_case, 0) obj->data.s = STRNDUP_ARG;
|
||||||
obj->callbacks.print = &print_cap;
|
obj->callbacks.print = &print_cap;
|
||||||
obj->callbacks.free = &gen_free_opaque;
|
obj->callbacks.free = &gen_free_opaque;
|
||||||
|
|
||||||
END OBJ(catp, 0) obj->data.s = STRNDUP_ARG;
|
END OBJ(catp, 0) obj->data.s = STRNDUP_ARG;
|
||||||
obj->callbacks.print = &print_catp;
|
obj->callbacks.print = &print_catp;
|
||||||
obj->callbacks.free = &gen_free_opaque;
|
obj->callbacks.free = &gen_free_opaque;
|
||||||
|
@ -101,6 +101,11 @@ void print_cap(struct text_object *obj, char *p, unsigned int p_max_size) {
|
|||||||
char *src = obj->data.s;
|
char *src = obj->data.s;
|
||||||
char *dest = buf;
|
char *dest = buf;
|
||||||
|
|
||||||
|
evaluate(obj->data.s, p, p_max_size);
|
||||||
|
if (0 != strcmp(p, "")) {
|
||||||
|
src = p;
|
||||||
|
}
|
||||||
|
|
||||||
for (; *src && p_max_size-1 > x; src++, x++) {
|
for (; *src && p_max_size-1 > x; src++, x++) {
|
||||||
if (0 == z) {
|
if (0 == z) {
|
||||||
*dest++ = (toupper((unsigned char) *src));
|
*dest++ = (toupper((unsigned char) *src));
|
||||||
|
Loading…
Reference in New Issue
Block a user