diff --git a/src/main/org/apache/tools/ant/types/FileSet.java b/src/main/org/apache/tools/ant/types/FileSet.java index 4781007f4..a1c610cb6 100644 --- a/src/main/org/apache/tools/ant/types/FileSet.java +++ b/src/main/org/apache/tools/ant/types/FileSet.java @@ -182,6 +182,10 @@ public class FileSet { * Returns the directory scanner needed to access the files to process. */ public DirectoryScanner getDirectoryScanner(Project p) { + if (dir == null) { + throw new BuildException("No directory specified for fileset."); + } + /* * XXX remove the check here and enable the one in setDir as soon * as we configure tasks at execution time. diff --git a/src/testcases/org/apache/tools/ant/types/CommandlineTest.java b/src/testcases/org/apache/tools/ant/types/CommandlineTest.java index ff2119f7e..d4a5ed9ea 100644 --- a/src/testcases/org/apache/tools/ant/types/CommandlineTest.java +++ b/src/testcases/org/apache/tools/ant/types/CommandlineTest.java @@ -115,9 +115,8 @@ public class CommandlineTest extends TestCase { // what the Unix sh does but causes a lot of problems on DOS // based platforms otherwise s = Commandline.translateCommandline("1 2\\ 3 4"); - assertEquals("case with quotes whitespace", 4, s.length); - assertEquals("Single quotes stripped, double quote included", "2\\", - s[1]); + assertEquals("case with quoted whitespace", 4, s.length); + assertEquals("backslash included", "2\\", s[1]); // now to the expected failures