(changelog_limit > 0))
{
gint64 time = rpmtdGetNumber(changelogtimes);
- if (last_time == time) {
- time += time_offset;
- time_offset++;
- } else {
- last_time = time;
- time_offset = 1;
- }
ChangelogEntry *changelog = changelog_entry_new();
changelog->author = rpmtdGetString(changelognames);
pkg->changelogs = g_slist_prepend(pkg->changelogs, changelog);
changelog_limit--;
- }
+ // If a previous entry has the same time, increment time of the previous
+ // entry by one. Ugly but works!
+ if (last_time == time) {
+ int tmp_time = time;
+ GSList *previous = pkg->changelogs;
+ while ((previous = g_slist_next(previous)) != NULL &&
+ ((ChangelogEntry *) (previous->data))->date == tmp_time) {
+ ((ChangelogEntry *) (previous->data))->date++;
+ tmp_time++;
+ }
+ } else {
+ last_time = time;
+ }
+
+
+ }
//pkg->changelogs = g_slist_reverse (pkg->changelogs);
}