dot2pic: Be less picky parsing "dot" output.
[sliver-openvswitch.git] / ovsdb / dot2pic
index 3e2f308..caca9f8 100755 (executable)
@@ -21,9 +21,10 @@ my ($scale) = 1;
 print ".PS\n";
 print "linethick = 1;\n";
 while (<>) {
-    if (/graph (\S+) (\S+) (\S+)/) {
-        $scale = $1;
-    } elsif (my ($name, $x, $y, $width, $height, $label, $style, $shape, $color, $fillcolor) = /node (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+)/) {
+    if (/^graph/) {
+        (undef, $scale) = split;
+    } elsif (/^node/) {
+        my (undef, $name, $x, $y, $width, $height, $label, $style, $shape, $color, $fillcolor) = split;
         $x *= $scale;
         $y *= $scale;
         $width *= $scale;