mirror of
https://github.com/rclone/rclone.git
synced 2025-02-22 00:37:24 +08:00
accounting: change too long names cutting mechanism - fixes #2490
This commit is contained in:
parent
cfe65f1e72
commit
e022ffce0f
@ -256,11 +256,14 @@ func (acc *Account) String() string {
|
|||||||
etas = "0s"
|
etas = "0s"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
name := []rune(acc.name)
|
name := []rune(acc.name)
|
||||||
if fs.Config.StatsFileNameLength > 0 {
|
if fs.Config.StatsFileNameLength > 0 {
|
||||||
if len(name) > fs.Config.StatsFileNameLength {
|
if len(name) > fs.Config.StatsFileNameLength {
|
||||||
where := len(name) - fs.Config.StatsFileNameLength
|
suffixLength := fs.Config.StatsFileNameLength / 2
|
||||||
name = append([]rune{'.', '.', '.'}, name[where:]...)
|
prefixLength := fs.Config.StatsFileNameLength - suffixLength
|
||||||
|
suffixStart := len(name) - suffixLength
|
||||||
|
name = append(append(name[:prefixLength], '…'), name[suffixStart:]...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user