From 67639b45355445f003bb9cada64be4ad058e359a Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Fri, 10 Apr 2015 06:31:03 -0700 Subject: [PATCH] gitweb: use cmd_pipe instead of exec 2>/dev/null When running the highlighter use cmd_pipe which throws away stderr rather than explicitly including a 'exec 2>/dev/null' in the command itself. Signed-off-by: Kyle J. McKay --- gitweb/gitweb.perl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 489a54f08b..45059c5974 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -3956,10 +3956,10 @@ sub run_highlighter { return $fd unless ($highlight && defined $syntax); close $fd; - open $fd, '-|', $posix_shell_bin, '-c', 'exec 2>/dev/null;'. + defined($fd = cmd_pipe $posix_shell_bin, '-c', quote_command(git_cmd(), "cat-file", "blob", $hash)." | ". quote_command($highlight_bin). - " --replace-tabs=8 --fragment --syntax $syntax" + " --replace-tabs=8 --fragment --syntax $syntax") or die_error(500, "Couldn't open file or run syntax highlighter"); return $fd; } -- 2.11.4.GIT