From d277315f3988758eacc2934fb4aaf316565e6206 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 16 May 2016 01:03:05 +0800 Subject: [PATCH] absolute paths on Windows appear to be valid URIs so we need explicitly exclude them (e.g. C:\path\to\script.groovy) --- source/net/filebot/cli/ScriptSource.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/net/filebot/cli/ScriptSource.java b/source/net/filebot/cli/ScriptSource.java index 371605ed..4f77a1a2 100644 --- a/source/net/filebot/cli/ScriptSource.java +++ b/source/net/filebot/cli/ScriptSource.java @@ -68,9 +68,14 @@ public enum ScriptSource { @Override public String accept(String input) { + // absolute paths on Windows appear to be valid URIs so we need explicitly exclude them (e.g. C:\path\to\script.groovy) + if (input.length() < 2 || input.charAt(1) == ':') { + return null; + } + try { URI uri = new URI(input); - if (uri.isAbsolute() && uri.getScheme().length() > 1) { + if (uri.isAbsolute()) { return getName(new File(uri.getPath())); } } catch (Exception e) {