1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 02:55:12 +00:00

Unbreak $combine.

This commit is contained in:
Brenden Matthews 2009-06-06 03:04:36 -06:00
parent 99f4a05e40
commit 384a41cb6e

View File

@ -2811,9 +2811,16 @@ static struct text_object *construct_text_object(const char *s,
obj->data.combine.left = malloc(endvar[0]-startvar[0] + 1); obj->data.combine.left = malloc(endvar[0]-startvar[0] + 1);
obj->data.combine.seperation = malloc(startvar[1] - endvar[0] + 1); obj->data.combine.seperation = malloc(startvar[1] - endvar[0] + 1);
obj->data.combine.right= malloc(endvar[1]-startvar[1] + 1); obj->data.combine.right= malloc(endvar[1]-startvar[1] + 1);
strncpy(obj->data.combine.left, arg+startvar[0], endvar[0]-startvar[0]); obj->data.combine.left[endvar[0]-startvar[0]]=0;
strncpy(obj->data.combine.seperation, arg+endvar[0], startvar[1]-endvar[0]); obj->data.combine.seperation[startvar[1]-endvar[0]]=0; strncpy(obj->data.combine.left, arg + startvar[0], endvar[0] - startvar[0]);
strncpy(obj->data.combine.right, arg+startvar[1], endvar[1]-startvar[1]); obj->data.combine.right[endvar[1]-startvar[1]]=0; obj->data.combine.left[endvar[0] - startvar[0]] = 0;
strncpy(obj->data.combine.seperation, arg + endvar[0], startvar[1] - endvar[0]);
obj->data.combine.seperation[startvar[1] - endvar[0]] = 0;
strncpy(obj->data.combine.right, arg + startvar[1], endvar[1] - startvar[1]);
obj->data.combine.right[endvar[1] - startvar[1]] = 0;
obj->sub = malloc(sizeof(struct text_object)); obj->sub = malloc(sizeof(struct text_object));
extract_variable_text_internal(obj->sub, obj->data.combine.left, 0); extract_variable_text_internal(obj->sub, obj->data.combine.left, 0);
obj->sub->sub = malloc(sizeof(struct text_object)); obj->sub->sub = malloc(sizeof(struct text_object));
@ -5529,23 +5536,13 @@ static void generate_text_internal(char *p, int p_max_size,
struct text_object * objsub = obj->sub; struct text_object * objsub = obj->sub;
p[0]=0; p[0]=0;
#ifdef HAVE_OPENMP
#pragma omp parallel for
#endif /* HAVE_OPENMP */
for(i=0; i<2; i++) { for(i=0; i<2; i++) {
nr_rows[i] = 1; nr_rows[i] = 1;
nextstart = 0; nextstart = 0;
ll_rows[i] = malloc(sizeof(struct llrows)); ll_rows[i] = malloc(sizeof(struct llrows));
current[i] = ll_rows[i]; current[i] = ll_rows[i];
#ifdef HAVE_OPENMP
#pragma omp parallel for
#endif /* HAVE_OPENMP */
for(j=0; j<i; j++) objsub = objsub->sub; for(j=0; j<i; j++) objsub = objsub->sub;
generate_text_internal(buf[i], max_user_text, *objsub, cur); generate_text_internal(buf[i], max_user_text, *objsub, cur);
/* doesnut work
* #ifdef HAVE_OPENMP
* #pragma omp parallel for reduction (+:nr_rows[i])
* #endif HAVE_OPENMP */
for(j=0; buf[i][j] != 0; j++) { for(j=0; buf[i][j] != 0; j++) {
if(buf[i][j] == '\t') buf[i][j] = ' '; if(buf[i][j] == '\t') buf[i][j] = ' ';
if(buf[i][j] == '\n') { if(buf[i][j] == '\n') {