Re: [PATCH] gitweb: support perl 5.6
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Sep 9, 2006, 22:20 UTC
- Message-ID
- <edveli$p2m$1@sea.gmane.org>
- In-Reply-To
- <20060909145914.GA25289@liacs.nl>
Sven Verdoolaege wrote:
Show 6 quoted lines
> +# returns pipe reading from git command with given arguments
> +sub git_pipe {
> + open my $fd, "-|", join(' ', git_cmd(), @_) or return undef;
> + return $fd;
> +}
> +I'm sorry, but this is not enough. For example the $file_name argument should be quoted in shell, i.e. in three argument magic open "-|". So either you return to your old patch, which changes each list form of open "-|" into old three argument form (which adds penalty of additional shell invocation, and is prone to shell interpretation of arguments), and sometimes add quotes (e.g. "... \'$file_name\' ..."), or (what would be better) to reimplement list form of open "-|" using two argument forking open "-|", and doing exec in child, a la "Safe Pipe Opens" in perlipc(3pm).
-- Jakub Narebski Warsaw, Poland ShadeHawk on #git