Permalink
Browse files

comments fix

  • Loading branch information...
carojkov committed May 11, 2011
1 parent d54c98e commit 5fff3d5b602f69ba53894811b000e0167ec4f45f
@@ -253,10 +253,28 @@ public void fillBaseArgs(List<String> args)
if (getMessage() != null) {
args.add("-m");
- args.add(getMessage());
+ args.add(quote(getMessage()));
}
}
+ private String quote(String message)
+ {
+ StringBuilder builder = new StringBuilder();
+
+ if (message.charAt(0) != '\'' && message.charAt(0) != '"') {
+ builder.append('\'');
+ }
+
+ builder.append(message);
+
+ char lastChar = message.charAt(message.length() - 1);
+ if (lastChar != '\'' && lastChar != '"') {
+ builder.append('\'');
+ }
+
+ return builder.toString();
+ }
+
protected abstract void fillArgs(List<String> args);
/**
Binary file not shown.

0 comments on commit 5fff3d5

Please sign in to comment.