From: jocuri%softhome.net <> Date: Tue, 22 Jun 2004 15:05:49 +0000 (+0000) Subject: Patch for bug 225359: Drawing dependency graphs should work on Win32; patch by Byron... X-Git-Tag: bugzilla-2.18rc1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b551925ac49548a80cc1f0bf94cb9cc991e09868;p=thirdparty%2Fbugzilla.git Patch for bug 225359: Drawing dependency graphs should work on Win32; patch by Byron Jones (glob) ; r=jouni; a=justdave. --- diff --git a/showdependencygraph.cgi b/showdependencygraph.cgi index e0bd376d55..b11562e1e4 100755 --- a/showdependencygraph.cgi +++ b/showdependencygraph.cgi @@ -226,14 +226,19 @@ if ($webdotbase =~ /^https?:/) { # First, generate the png image file from the .dot source - my $dotfh; my ($pngfh, $pngfilename) = File::Temp::tempfile("XXXXXXXXXX", SUFFIX => '.png', DIR => $webdotdir); - open (DOT, '-|') or exec ($webdotbase, "-Tpng", $filename); + binmode $pngfh; + open(DOT, "$webdotbase -Tpng $filename|"); + binmode DOT; print $pngfh $_ while ; close DOT; close $pngfh; + + # On Windows $pngfilename will contain \ instead of / + $pngfilename =~ s|\\|/|g if $^O eq 'MSWin32'; + $vars->{'image_url'} = $pngfilename; # Then, generate a imagemap datafile that contains the corner data @@ -243,7 +248,9 @@ if ($webdotbase =~ /^https?:/) { my ($mapfh, $mapfilename) = File::Temp::tempfile("XXXXXXXXXX", SUFFIX => '.map', DIR => $webdotdir); - open (DOT, '-|') or exec ($webdotbase, "-Tismap", $filename); + binmode $mapfh; + open(DOT, "$webdotbase -Tismap $filename|"); + binmode DOT; print $mapfh $_ while ; close DOT; close $mapfh;