Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/fileInfo.go')
-rw-r--r--source/fileInfo.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/fileInfo.go b/source/fileInfo.go
index e4b4a80fb..a20ba27e5 100644
--- a/source/fileInfo.go
+++ b/source/fileInfo.go
@@ -162,9 +162,12 @@ func (fi *FileInfo) init() {
}
func (sp *SourceSpec) NewFileInfo(baseDir, filename string, fi os.FileInfo) *FileInfo {
+
dir, name := filepath.Split(filename)
+ if !strings.HasSuffix(dir, helpers.FilePathSeparator) {
+ dir = dir + helpers.FilePathSeparator
+ }
- dir = strings.TrimSuffix(dir, helpers.FilePathSeparator)
baseDir = strings.TrimSuffix(baseDir, helpers.FilePathSeparator)
relDir := ""