(refs #445)Fix yen to backslash

This commit is contained in:
takezoe
2014-07-27 17:11:27 +09:00
parent 34e299bf52
commit 2a8706630a
2 changed files with 3 additions and 3 deletions

View File

@@ -102,7 +102,7 @@ object JGitUtil {
/** /**
* the line separator of this content ("LF" or "CRLF") * the line separator of this content ("LF" or "CRLF")
*/ */
val lineSeparator: String = if(content.exists(_.indexOf("¥r¥n") >= 0)) "CRLF" else "LF" val lineSeparator: String = if(content.exists(_.indexOf("\r\n") >= 0)) "CRLF" else "LF"
} }
/** /**

View File

@@ -54,9 +54,9 @@ object StringUtil {
* @return the converted content * @return the converted content
*/ */
def convertLineSeparator(content: String, lineSeparator: String): String = { def convertLineSeparator(content: String, lineSeparator: String): String = {
val lf = content.replaceAll("¥r¥n", "¥n").replaceAll("¥r", "¥n") val lf = content.replace("\r\n", "\n").replace("\r", "\n")
if(lineSeparator == "CRLF"){ if(lineSeparator == "CRLF"){
lf.replaceAll("¥n", "¥r¥n") lf.replace("\n", "\r\n")
} else { } else {
lf lf
} }