From 50e79b94765f06906d4b2b2e1f168436f6c3a1f4 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 17 Mar 2023 17:01:50 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E6=96=87=E4=BB=B6=E5=90=8D=E5=8C=85?= =?UTF-8?q?=E5=90=AB=20`.`=20=E6=97=B6=E7=9A=84=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20Fix=20https://github.com/siyuan-note/siyua?= =?UTF-8?q?n/issues/7686?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/assets.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/model/assets.go b/kernel/model/assets.go index 57632afde..23eed4f10 100644 --- a/kernel/model/assets.go +++ b/kernel/model/assets.go @@ -492,7 +492,7 @@ func RenameAsset(oldPath, newName string) (err error) { return } - newName = util.AssetName(newName) + filepath.Ext(oldPath) + newName = util.AssetName(newName + filepath.Ext(oldPath)) newPath := "assets/" + newName if err = filelock.Copy(filepath.Join(util.DataDir, oldPath), filepath.Join(util.DataDir, newPath)); nil != err { logging.LogErrorf("copy asset [%s] failed: %s", oldPath, err)