From 84a3c98d16dc63c9fec1521791fb5ee7556bc827 Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Mon, 5 Feb 2007 09:22:16 +0000 Subject: [PATCH] Double quotes don't work correctly in the Unix exec (reported by Dirk Datzert) Run exec(String []), which I tested to work on both Windows and Unix. --- .../umlgraph/doclet/UmlGraphDoc.java | 20 +++++++++---------- src/org/umlgraph/doclet/UmlGraphDoc.java | 20 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/gr/spinellis/umlgraph/doclet/UmlGraphDoc.java b/src/gr/spinellis/umlgraph/doclet/UmlGraphDoc.java index 9cbc6f6..7a5669f 100644 --- a/src/gr/spinellis/umlgraph/doclet/UmlGraphDoc.java +++ b/src/gr/spinellis/umlgraph/doclet/UmlGraphDoc.java @@ -128,16 +128,16 @@ public class UmlGraphDoc { File mapFile = new File(outputFolder, packageName.replace(".", "/") + "/" + name + ".map"); try { - /* - * Put filenames inside double quote characters to allow - * (typically Windows) files with embedded whitespace to - * work. This will still fail with Unix ` and $ characters, - * but it is better than nothing. - */ - String command = "dot -Tcmapx -o\"" + mapFile.getAbsolutePath() + "\" -Tpng -o\"" + - pngFile.getAbsolutePath() + "\" \"" + - dotFile.getAbsolutePath() + "\""; - Process p = Runtime.getRuntime().exec(command); + Process p = Runtime.getRuntime().exec(new String [] { + "dot", + "-Tcmapx", + "-o", + mapFile.getAbsolutePath(), + "-Tpng", + "-o", + pngFile.getAbsolutePath(), + dotFile.getAbsolutePath() + }); BufferedReader reader = new BufferedReader(new InputStreamReader(p.getErrorStream())); String line = null; while((line = reader.readLine()) != null) diff --git a/src/org/umlgraph/doclet/UmlGraphDoc.java b/src/org/umlgraph/doclet/UmlGraphDoc.java index 9cbc6f6..7a5669f 100644 --- a/src/org/umlgraph/doclet/UmlGraphDoc.java +++ b/src/org/umlgraph/doclet/UmlGraphDoc.java @@ -128,16 +128,16 @@ public class UmlGraphDoc { File mapFile = new File(outputFolder, packageName.replace(".", "/") + "/" + name + ".map"); try { - /* - * Put filenames inside double quote characters to allow - * (typically Windows) files with embedded whitespace to - * work. This will still fail with Unix ` and $ characters, - * but it is better than nothing. - */ - String command = "dot -Tcmapx -o\"" + mapFile.getAbsolutePath() + "\" -Tpng -o\"" + - pngFile.getAbsolutePath() + "\" \"" + - dotFile.getAbsolutePath() + "\""; - Process p = Runtime.getRuntime().exec(command); + Process p = Runtime.getRuntime().exec(new String [] { + "dot", + "-Tcmapx", + "-o", + mapFile.getAbsolutePath(), + "-Tpng", + "-o", + pngFile.getAbsolutePath(), + dotFile.getAbsolutePath() + }); BufferedReader reader = new BufferedReader(new InputStreamReader(p.getErrorStream())); String line = null; while((line = reader.readLine()) != null)