mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 09:04:52 +01: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"
|
||||
}
|
||||
}
|
||||
|
||||
name := []rune(acc.name)
|
||||
if fs.Config.StatsFileNameLength > 0 {
|
||||
if len(name) > fs.Config.StatsFileNameLength {
|
||||
where := len(name) - fs.Config.StatsFileNameLength
|
||||
name = append([]rune{'.', '.', '.'}, name[where:]...)
|
||||
suffixLength := fs.Config.StatsFileNameLength / 2
|
||||
prefixLength := fs.Config.StatsFileNameLength - suffixLength
|
||||
suffixStart := len(name) - suffixLength
|
||||
name = append(append(name[:prefixLength], '…'), name[suffixStart:]...)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user