From 8621dc370e14557a07438a6d6801740eeb63d099 Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Fri, 17 Dec 2021 00:28:41 +0800 Subject: [PATCH] update --- system/setup.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/system/setup.go b/system/setup.go index 8817063..1e4803c 100644 --- a/system/setup.go +++ b/system/setup.go @@ -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])