1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-18 13:14:13 +00:00

fix window's slash

This commit is contained in:
astaxie 2013-03-15 14:50:56 +08:00
parent b6df895df8
commit 3c4dd99fbe

View File

@ -140,9 +140,10 @@ func (self *templatefile) visit(paths string, f os.FileInfo, err error) error {
}
}
if hasExt {
replace := strings.NewReplacer("\\", "/")
a := []byte(paths)
a = a[len([]byte(self.root)):]
subdir := path.Dir(strings.TrimLeft(string(a), "/"))
subdir := path.Dir(replace.Replace(strings.TrimLeft(string(a), "/")))
if _, ok := self.files[subdir]; ok {
self.files[subdir] = append(self.files[subdir], paths)
} else {