summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmitai Schlair <schmonz@magnetic-babysitter.(none)>2009-08-30 16:13:17 -0400
committerAmitai Schlair <schmonz@magnetic-babysitter.(none)>2009-08-30 16:13:17 -0400
commit1af7d7d8429b6e73493a5f8ba877c6cfb888cfe1 (patch)
tree8260cf451273a625b5aa81a9c8ef6ae1b5d1c9af
parente972cadf78ba511af33ba19d40c5b6156569120d (diff)
On some systems the commit message gets quoted properly already. Don't
requote in such cases, do quote in all others.
-rw-r--r--IkiWiki/Plugin/cvs.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/cvs.pm b/IkiWiki/Plugin/cvs.pm
index fa4c4da8e..849302df4 100644
--- a/IkiWiki/Plugin/cvs.pm
+++ b/IkiWiki/Plugin/cvs.pm
@@ -119,11 +119,21 @@ sub cvs_runcvs(@) {
sub cvs_shquote_commit ($) {
my $message = shift;
+ my $test_message = "CVS autodiscover quoting CVS";
eval q{use String::ShellQuote};
error($@) if $@;
+ eval q{use IPC::Cmd};
+ error($@) if $@;
- return shell_quote(IkiWiki::possibly_foolish_untaint($message));
+ my $cmd = ['echo', shell_quote($test_message)];
+ my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf) =
+ IPC::Cmd::run(command => $cmd, verbose => 0);
+ if ((grep /'$test_message'/, @$stdout_buf) > 0) {
+ return IkiWiki::possibly_foolish_untaint($message);
+ } else {
+ return shell_quote(IkiWiki::possibly_foolish_untaint($message));
+ }
}
sub cvs_is_controlling {