Browse Source

Ensure quoted strings for javadoc are interpreted properly by the shell

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267577 13f79535-47bb-0310-9956-ffa450edef68
master
Sam Ruby 25 years ago
parent
commit
d904d0c097
2 changed files with 7 additions and 8 deletions
  1. +1
    -2
      src/bin/antRun
  2. +6
    -6
      src/main/org/apache/tools/ant/taskdefs/Exec.java

+ 1
- 2
src/bin/antRun View File

@@ -10,5 +10,4 @@ if test -e $CMD.sh; then
CMD="sh $CMD.sh"
fi

echo $CMD $@
$CMD $@
echo $CMD $@ | sh

+ 6
- 6
src/main/org/apache/tools/ant/taskdefs/Exec.java View File

@@ -67,12 +67,17 @@ import java.io.*;
public class Exec extends Task {
private String os;
private String out;
private String dir;
private String dir = ".";
private String command;

private static final int BUFFER_SIZE = 512;

public void execute() throws BuildException {
run(command);
}

protected void run(String command) throws BuildException {

// test if os match
String myos = System.getProperty("os.name");
project.log("Myos = " + myos, Project.MSG_VERBOSE);
@@ -89,11 +94,6 @@ public class Exec extends Task {
if (myos.toLowerCase().indexOf("windows") >= 0) antRun = antRun + ".bat";
command = antRun + " " + project.resolveFile(dir) + " " + command;

run(command);
}

protected void run(String command) throws BuildException {

try {
// show the command
project.log(command, "exec", Project.MSG_VERBOSE);


Loading…
Cancel
Save