1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-11 10:38:12 +00:00

no need to save the args passed to if_empty and if_match

This commit is contained in:
Phil Sutter 2009-10-27 01:24:52 +01:00
parent 7304378d73
commit 66c187e7a1

View File

@ -551,13 +551,11 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ(loadavg, &update_load_average)
scan_loadavg_arg(obj, arg);
END OBJ_IF_ARG(if_empty, 0, "if_empty needs an argument")
obj->data.ifblock.s = strndup(arg, text_buffer_size);
obj->sub = malloc(sizeof(struct text_object));
extract_variable_text_internal(obj->sub, obj->data.ifblock.s);
extract_variable_text_internal(obj->sub, arg);
END OBJ_IF_ARG(if_match, 0, "if_match needs arguments")
obj->data.ifblock.s = strndup(arg, text_buffer_size);
obj->sub = malloc(sizeof(struct text_object));
extract_variable_text_internal(obj->sub, obj->data.ifblock.s);
extract_variable_text_internal(obj->sub, arg);
END OBJ_IF_ARG(if_existing, 0, "if_existing needs an argument or two")
char buf1[256], buf2[256];
int r = sscanf(arg, "%255s %255[^\n]", buf1, buf2);
@ -1281,7 +1279,7 @@ void free_text_objects(struct text_object *root, int internal)
case OBJ_if_match:
free_text_objects(obj->sub, 1);
free(obj->sub);
/* fall through */
break;
case OBJ_if_existing:
case OBJ_if_mounted:
case OBJ_if_running: