shithub: hugo

Download patch

ref: 41a516819846b98e3b3d13d03815d6d325fbc1e5
parent: 5e2d3d2e10a4cf1935c2226b023bde2f3ce9e7c0
author: Cyrill Schumacher <[email protected]>
date: Sun Dec 28 05:10:58 EST 2014

Fix bug on windows where the backslash got removed in func MakePath()

--- a/helpers/path.go
+++ b/helpers/path.go
@@ -446,7 +446,14 @@
 		dir = dir + FilePathSeparator
 	}
 	if subPath != "" {
+		// preserve windows backslash :-(
+		if FilePathSeparator == "\\" {
+			subPath = strings.Replace(subPath, "\\", "____", -1)
+		}
 		dir = dir + MakePath(subPath)
+		if FilePathSeparator == "\\" {
+			dir = strings.Replace(dir, "____", "\\", -1)
+		}
 
 		if exists, _ := Exists(dir, fs); exists {
 			return dir