From bfce0def25bab777d9287136c60e6e30e9f18591 Mon Sep 17 00:00:00 2001
From: Unknwon <joe2010xtmf@163.com>
Date: Mon, 2 Feb 2015 23:04:36 -0500
Subject: [PATCH] modules/base: fix README filename checker, fix #877

---
 gogs.go                  | 2 +-
 modules/base/markdown.go | 8 +++++++-
 templates/.VERSION       | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/gogs.go b/gogs.go
index 423d301907..1f0f15b8bf 100644
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
 	"github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.5.12.0201 Beta"
+const APP_VER = "0.5.12.0202 Beta"
 
 func init() {
 	runtime.GOMAXPROCS(runtime.NumCPU())
diff --git a/modules/base/markdown.go b/modules/base/markdown.go
index c7369ab9fd..d3f3e5feaf 100644
--- a/modules/base/markdown.go
+++ b/modules/base/markdown.go
@@ -63,12 +63,18 @@ func IsImageFile(data []byte) (string, bool) {
 	return contentType, false
 }
 
+// IsReadmeFile returns true if given file name suppose to be a README file.
 func IsReadmeFile(name string) bool {
 	name = strings.ToLower(name)
 	if len(name) < 6 {
 		return false
+	} else if len(name) == 6 {
+		if name == "readme" {
+			return true
+		}
+		return false
 	}
-	if name[:6] == "readme" {
+	if name[:7] == "readme." {
 		return true
 	}
 	return false
diff --git a/templates/.VERSION b/templates/.VERSION
index 6e3c63ed85..aa8ee543a2 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.5.12.0201 Beta
\ No newline at end of file
+0.5.12.0202 Beta
\ No newline at end of file