diff options
author | Tor Norbye <tnorbye@google.com> | 2012-02-14 12:27:10 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-02-14 12:27:10 -0800 |
commit | ef6d36c7bece54393e9f1390c8162c6c3059d77e (patch) | |
tree | a1d0c34b2fe4cec19f788fec3dba25707aed06d8 /lint/cli | |
parent | 0328c6fa70f8ab0b8e4e87e01e938c6826b88d62 (diff) | |
download | sdk-ef6d36c7bece54393e9f1390c8162c6c3059d77e.zip sdk-ef6d36c7bece54393e9f1390c8162c6c3059d77e.tar.gz sdk-ef6d36c7bece54393e9f1390c8162c6c3059d77e.tar.bz2 |
Fix for lint cli relative output paths
Change-Id: I4e37e68661007a825c97948e6258201babcd2b79
Diffstat (limited to 'lint/cli')
-rw-r--r-- | lint/cli/src/com/android/tools/lint/Main.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lint/cli/src/com/android/tools/lint/Main.java b/lint/cli/src/com/android/tools/lint/Main.java index c57ec36..1484a1d 100644 --- a/lint/cli/src/com/android/tools/lint/Main.java +++ b/lint/cli/src/com/android/tools/lint/Main.java @@ -264,6 +264,9 @@ public class Main extends LintClient { System.exit(ERRNO_INVALIDARGS); } File output = new File(args[++index]); + // Get an absolute path such that we can ask its parent directory for + // write permission etc. + output = output.getAbsoluteFile(); if (output.isDirectory() || (!output.exists() && output.getName().indexOf('.') == -1)) { if (!output.exists()) { @@ -293,7 +296,7 @@ public class Main extends LintClient { System.exit(ERRNO_EXISTS); } } - if (!output.getParentFile().canWrite()) { + if (output.getParentFile() != null && !output.getParentFile().canWrite()) { System.err.println("Cannot write HTML output file " + output); System.exit(ERRNO_EXISTS); } |