mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-05 01:44:36 -04:00
[BUG] Sort file list case insensitively
- Make the sorting done on the entries list case insensitive. - Adds integration test. - Resolves #317
This commit is contained in:
parent
d0e5af7079
commit
86b46085c7
3 changed files with 70 additions and 0 deletions
|
@ -5,11 +5,13 @@ package base
|
|||
|
||||
import (
|
||||
"math/big"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
// NaturalSortLess compares two strings so that they could be sorted in natural order
|
||||
func NaturalSortLess(s1, s2 string) bool {
|
||||
s1, s2 = strings.ToLower(s1), strings.ToLower(s2)
|
||||
var i1, i2 int
|
||||
for {
|
||||
rune1, j1, end1 := getNextRune(s1, i1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue