forked from TrueCloudLab/rclone
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"
|
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…
Add table
Reference in a new issue