Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2026-06-12 00:15:06 +01:00

11
sort.c
View File

@@ -65,7 +65,12 @@ sort_buffer_cmp(const void *a0, const void *b0)
result = strcmp(pa->name, pb->name); result = strcmp(pa->name, pb->name);
break; break;
case SORT_CREATION: case SORT_CREATION:
result = pa->order - pb->order; if (pa->order > pb->order)
result = -1;
else if (pa->order < pb->order)
result = 1;
else
result = 0;
break; break;
case SORT_SIZE: case SORT_SIZE:
result = pa->size - pb->size; result = pa->size - pb->size;
@@ -251,11 +256,11 @@ sort_winlink_cmp(const void *a0, const void *b0)
break; break;
case SORT_CREATION: case SORT_CREATION:
if (timercmp(&wa->creation_time, &wb->creation_time, >)) { if (timercmp(&wa->creation_time, &wb->creation_time, >)) {
result = -1; result = 1;
break; break;
} }
if (timercmp(&wa->creation_time, &wb->creation_time, <)) { if (timercmp(&wa->creation_time, &wb->creation_time, <)) {
result = 1; result = -1;
break; break;
} }
break; break;