mirror of
https://github.com/jarun/nnn.git
synced 2025-01-25 02:06:50 +00:00
Fix mtime comparison
This commit is contained in:
parent
201b1ae571
commit
406faf63d9
17
src/nnn.c
17
src/nnn.c
|
@ -1486,28 +1486,23 @@ static int entrycmp(const void *va, const void *vb)
|
|||
if ((pb->flags & DIR_OR_LINK_TO_DIR) != (pa->flags & DIR_OR_LINK_TO_DIR)) {
|
||||
if (pb->flags & DIR_OR_LINK_TO_DIR)
|
||||
return 1;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Do the actual sorting */
|
||||
/* Sort based on specified order */
|
||||
if (cfg.mtimeorder) {
|
||||
if (pb->t >= pa->t)
|
||||
return (int)(pb->t - pa->t);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (cfg.sizeorder) {
|
||||
if (pb->t > pa->t)
|
||||
return 1;
|
||||
if (pb->t < pa->t)
|
||||
return -1;
|
||||
} else if (cfg.sizeorder) {
|
||||
if (pb->size > pa->size)
|
||||
return 1;
|
||||
|
||||
if (pb->size < pa->size)
|
||||
return -1;
|
||||
} else if (cfg.blkorder) {
|
||||
if (pb->blocks > pa->blocks)
|
||||
return 1;
|
||||
|
||||
if (pb->blocks < pa->blocks)
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue