aboutsummaryrefslogtreecommitdiffstats
path: root/modules/svg
diff options
context:
space:
mode:
authorCirno the Strongest <1447794+CirnoT@users.noreply.github.com>2020-07-13 22:16:40 +0200
committerGitHub <noreply@github.com>2020-07-13 21:16:40 +0100
commit633f52c220b2f24b57f6ebaf88c108aac1d89f43 (patch)
tree6d99d4fcac118e923e3f24cca411d4be5b2b5b29 /modules/svg
parent84a419de98701fe1e8a0d7f1be5d82c7f5e4ac92 (diff)
downloadgitea-633f52c220b2f24b57f6ebaf88c108aac1d89f43.tar.gz
gitea-633f52c220b2f24b57f6ebaf88c108aac1d89f43.zip
Fix filepath basename on Windows for SVG bindata (#12241)
Diffstat (limited to 'modules/svg')
-rw-r--r--modules/svg/discover_bindata.go3
-rw-r--r--modules/svg/discover_nobindata.go5
2 files changed, 3 insertions, 5 deletions
diff --git a/modules/svg/discover_bindata.go b/modules/svg/discover_bindata.go
index 51fd8a4a6c..1f7af0c9f8 100644
--- a/modules/svg/discover_bindata.go
+++ b/modules/svg/discover_bindata.go
@@ -7,7 +7,6 @@
package svg
import (
- "path"
"path/filepath"
"code.gitea.io/gitea/modules/public"
@@ -22,7 +21,7 @@ func Discover() map[string]string {
if matched {
content, err := public.Asset(file)
if err == nil {
- filename := path.Base(file)
+ filename := filepath.Base(file)
svgs[filename[:len(filename)-4]] = string(content)
}
}
diff --git a/modules/svg/discover_nobindata.go b/modules/svg/discover_nobindata.go
index 04ce447de8..d667da2d66 100644
--- a/modules/svg/discover_nobindata.go
+++ b/modules/svg/discover_nobindata.go
@@ -8,7 +8,6 @@ package svg
import (
"io/ioutil"
- "path"
"path/filepath"
"code.gitea.io/gitea/modules/setting"
@@ -18,11 +17,11 @@ import (
func Discover() map[string]string {
svgs := make(map[string]string)
- files, _ := filepath.Glob(path.Join(setting.StaticRootPath, "public", "img", "svg", "*.svg"))
+ files, _ := filepath.Glob(filepath.Join(setting.StaticRootPath, "public", "img", "svg", "*.svg"))
for _, file := range files {
content, err := ioutil.ReadFile(file)
if err == nil {
- filename := path.Base(file)
+ filename := filepath.Base(file)
svgs[filename[:len(filename)-4]] = string(content)
}
}