X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fcom%2Fdogcows%2FUtil.java;h=412ef4a95b2e24258ec137777cb7bbfe3e058048;hb=c4d7e0da9accfe7aed04c768892b08e18ad085fd;hp=3253ae223c5515457949c2012fb6c658be05d5c9;hpb=5d17e009eff7a333349813221e7a0a1b2087d8d4;p=chaz%2Fvimcoder diff --git a/src/com/dogcows/Util.java b/src/com/dogcows/Util.java index 3253ae2..412ef4a 100644 --- a/src/com/dogcows/Util.java +++ b/src/com/dogcows/Util.java @@ -61,12 +61,12 @@ public abstract class Util } /** - * Quote a string by replacing prepending backslashes and double + * Escape a string by replacing prepending backslashes and double * quotation characters with an extra backslash. - * @param The string to be quoted. - * @return The quoted string. + * @param The string to be escaped. + * @return The escaped string. */ - public static String quote(String a) + public static String escape(String a) { a = a.replaceAll("\\\\", "\\\\\\\\"); a = a.replaceAll("\"", "\\\\\\\""); @@ -151,8 +151,7 @@ public abstract class Util String text = template; for (String key : terms.keySet()) { - text = text.replaceAll("\\$" + key + "\\$", - Util.quote(terms.get(key))); + text = text.replaceAll("\\$" + key + "\\$", Util.escape(terms.get(key))); } return text; }