Fixed incomplete filename

This commit is contained in:
bytedream 2021-10-14 16:32:47 +02:00
parent 1f1f6feeca
commit bc3bfb1c5f

View file

@ -263,7 +263,7 @@ func createOrDefaultClient(proxy string) (*http.Client, error) {
func freeFileName(filename string) (string, bool) {
ext := path.Ext(filename)
base := strings.TrimRight(filename, ext)
base := strings.TrimSuffix(filename, ext)
j := 0
for ; ; j++ {
if _, stat := os.Stat(filename); stat != nil && !os.IsExist(stat) {