> An alternative patch:
>
> /* if date part matches */
> if (strlen(attrib[index]) > 0 && strncmp(attrib[index], retstr, loc) == 0)
> /* retrieve old index */
> if (atoi(attrib[index] + loc) > old_index)
> old_index = atoi(attrib[index] + loc);
>
> does not make this assumption and also appears to work OK when I test it.
Yes, this is the right one, it searches all entries to have the same date than the current one, and then looks for the
largest index which will be stored in old_index and later incremented by one. I committed your patch to the
repository. Thanks a lot. |