]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Patch for bug 225359: Drawing dependency graphs should work on Win32; patch by Byron...
authorjocuri%softhome.net <>
Tue, 22 Jun 2004 15:05:49 +0000 (15:05 +0000)
committerjocuri%softhome.net <>
Tue, 22 Jun 2004 15:05:49 +0000 (15:05 +0000)
showdependencygraph.cgi

index e0bd376d55d4cc9c243ad25d7be64219bdb212fd..b11562e1e421dd234b915218a8806eabcfae3c46 100755 (executable)
@@ -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 <DOT>;
     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 <DOT>;
     close DOT;
     close $mapfh;