X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=inline;f=src%2Fcom%2Fdogcows%2FUtil.java;h=eda8fff35167cc8cbc2d2de5ef2687ed108997dc;hb=15cdeb736935e012a479d24c50ff10b88553bf9f;hp=3253ae223c5515457949c2012fb6c658be05d5c9;hpb=5d17e009eff7a333349813221e7a0a1b2087d8d4;p=chaz%2Fvimcoder diff --git a/src/com/dogcows/Util.java b/src/com/dogcows/Util.java index 3253ae2..eda8fff 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,10 +151,10 @@ 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; } } +// vim:noet:ts=8