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

oops, tail was b0rked

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@477 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Brenden Matthews 2006-01-06 05:11:28 +00:00
parent 7c5d4fab42
commit a53ed0d0ab

View File

@ -3229,7 +3229,9 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object *
OBJ(tail) {
if (current_update_time -obj->data.tail.last_update >= obj->data.tail.interval) {
if (current_update_time -obj->data.tail.last_update < obj->data.tail.interval) {
snprintf(p, p_max_size, "%s", obj->data.tail.buffer);
} else {
obj->data.tail.last_update = current_update_time;
FILE *fp;
int i;
@ -3278,10 +3280,12 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object *
if (obj->data.tail.buffer[strlen(obj->data.tail.buffer)-1] == '\n') {
obj->data.tail.buffer[strlen(obj->data.tail.buffer)-1] = '\0';
}
snprintf(p, p_max_size, "%s", obj->data.tail.buffer);
freetail(freetmp);
} else {
strcpy(obj->data.tail.buffer, "Logfile Empty");
snprintf(p, p_max_size, "Logfile Empty");
} /* if readlines */
} /* fp == NULL */
} /* if cur_upd_time >= */
@ -3290,7 +3294,9 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object *
}
OBJ(head) {
if (current_update_time -obj->data.tail.last_update >= obj->data.tail.interval) {
if (current_update_time -obj->data.tail.last_update < obj->data.tail.interval) {
snprintf(p, p_max_size, "%s", obj->data.tail.buffer);
} else {
obj->data.tail.last_update = current_update_time;
FILE *fp;
tailstring *head = NULL;
@ -3325,8 +3331,10 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object *
if (obj->data.tail.buffer[strlen(obj->data.tail.buffer)-1] == '\n') {
obj->data.tail.buffer[strlen(obj->data.tail.buffer)-1] = '\0';
}
snprintf(p, p_max_size, "%s", obj->data.tail.buffer);
} else {
strcpy(obj->data.tail.buffer, "Logfile Empty");
snprintf(p, p_max_size, "Logfile Empty");
} /* if readlines > 0 */
} /* if fp == null */
} /* cur_upd_time >= */