fixed qe_collate to sort system buffers last
This commit is contained in:
parent
eab4195f2f
commit
53bf5ef8c2
1 changed files with 9 additions and 2 deletions
11
util.c
11
util.c
|
|
@ -445,7 +445,7 @@ void splitpath(char *dirname, int dirname_size,
|
|||
}
|
||||
|
||||
/* smart compare strings, lexicographical order, but collate numbers in
|
||||
* numeric order */
|
||||
* numeric order, and push * at end */
|
||||
int qe_collate(const char *s1, const char *s2)
|
||||
{
|
||||
int last, c1, c2, res, flags;
|
||||
|
|
@ -462,7 +462,14 @@ int qe_collate(const char *s1, const char *s2)
|
|||
break;
|
||||
}
|
||||
}
|
||||
res = (c1 < c2) ? -1 : 1;
|
||||
if (c1 == '*')
|
||||
res = 1;
|
||||
else
|
||||
if (c2 == '*')
|
||||
res = -1;
|
||||
else
|
||||
res = (c1 < c2) ? -1 : 1;
|
||||
|
||||
for (;;) {
|
||||
flags = qe_isdigit(c1) * 2 + qe_isdigit(c2);
|
||||
if (flags == 3) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue