update
parent
0a47f12905
commit
8621dc370e
|
@ -67,15 +67,19 @@ func Setup() {
|
|||
segs := strings.Split(c, ":")
|
||||
file := segs[len(segs)-2]
|
||||
short := file
|
||||
skip := false
|
||||
ptr := 0
|
||||
for i := len(file) - 1; i > 0; i-- {
|
||||
if file[i] == '/' {
|
||||
if !skip {
|
||||
skip = true
|
||||
continue
|
||||
if ptr == 0 {
|
||||
short = file[i+1:]
|
||||
ptr = i
|
||||
} else {
|
||||
short = fmt.Sprintf("%v/%v", file[i+1:ptr], short)
|
||||
break
|
||||
}
|
||||
short = file[i+1:]
|
||||
break
|
||||
}
|
||||
if file[i] == '@' {
|
||||
ptr = i
|
||||
}
|
||||
}
|
||||
return fmt.Sprintf("%v:%v", short, segs[len(segs)-1])
|
||||
|
|
Loading…
Reference in New Issue