From cb49a54ee628d82fdf1c0c9c065c64806f37533d Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Thu, 25 Jun 2009 08:07:03 +0000 Subject: [PATCH] Fixed problem with auto indices SVN revision: 2216 --- src/elogd.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 0e1bc783..d712fa18 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -8729,13 +8729,10 @@ void get_auto_index(LOGBOOK * lbs, int index, char *format, char *retstr, int si el_retrieve(lbs, message_id, NULL, attr_list, attrib, lbs->n_attr, NULL, 0, NULL, NULL, att, NULL, NULL); - /* if date part changed, start over with index */ - if (strlen(attrib[index]) > 0 && strncmp(attrib[index], retstr, loc) != 0) - old_index = 0; - else - /* retrieve old index */ - if (atoi(attrib[index] + loc) > old_index) - old_index = atoi(attrib[index] + loc); + /* if same date found, obtain largest index */ + if (strlen(attrib[index]) > 0 && strncmp(attrib[index], retstr, loc) == 0) + if (atoi(attrib[index] + loc) > old_index) + old_index = atoi(attrib[index] + loc); message_id = el_search_message(lbs, EL_PREV, message_id, FALSE);