Merge branch 'stable-2.6' into stable-2.7

* stable-2.6:
  PrettyFormatter: Fix ArrayIndexOutOfBoundException with CRLF files.
This commit is contained in:
Shawn Pearce 2013-07-01 10:18:35 -07:00
commit e4a159d371

View File

@ -146,9 +146,9 @@ public abstract class PrettyFormatter implements SparseHtmlFile {
// Drop any '\r' to avoid this problem.
html = html.replace("\r</span>\n", "</span>\n");
html = html.replace("\n", " \n");
html = html.replaceAll("(\r)?\n", " $1\n");
html = prettify(html, getFileType());
html = html.replace(" \n", "\n");
html = html.replaceAll(" (\r)?\n", "$1\n");
} else {
html = expandTabs(html);
}