From 2797a659db82dd1a0021dacd005fa80212c41579 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 18 Jun 2010 12:48:05 -0400 Subject: mercurial: Fix buggy getctime code. The file passed to rcs_getctime is already absolute, and it was trying to stick the srcdir on the front. Also, eliminated potentially unsafe shelling. --- IkiWiki/Plugin/mercurial.pm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/mercurial.pm b/IkiWiki/Plugin/mercurial.pm index 34e009c7a..a80bb2da5 100644 --- a/IkiWiki/Plugin/mercurial.pm +++ b/IkiWiki/Plugin/mercurial.pm @@ -236,15 +236,13 @@ sub rcs_diff ($) { sub rcs_getctime ($) { my ($file) = @_; - # XXX filename passes through the shell here, should try to avoid - # that just in case my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v", - "--style", "default", "$config{srcdir}/$file"); - open (my $out, "@cmdline |"); + "--style", "default", $file); + open (my $out, "-|", @cmdline); - my @log = mercurial_log($out); + my @log = (mercurial_log($out)); - if (length @log < 1) { + if (@log < 1) { return 0; } -- cgit v1.2.3