accounting: change too long names cutting mechanism - fixes #2490
This commit is contained in:
parent
cfe65f1e72
commit
e022ffce0f
1 changed files with 5 additions and 2 deletions
|
@ -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 a new issue