From 7e12aea1d8f90d375627acc9f4a532009781aa26 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 2 Oct 2014 21:17:31 +0200 Subject: input/Open: use OpenLocalInputStream() Make the "open" method of plugins "file" and "archive" dummy methods that always fail. Instead, let InputStream::Open() hard-code access to these two plugins by using OpenLocalInputStream(). This allows simplifyin the algorithm for falling back to probing archive plugins. --- src/input/Open.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/input/Open.cxx') diff --git a/src/input/Open.cxx b/src/input/Open.cxx index 6e89569d6..18572d6b2 100644 --- a/src/input/Open.cxx +++ b/src/input/Open.cxx @@ -21,7 +21,10 @@ #include "InputStream.hxx" #include "Registry.hxx" #include "InputPlugin.hxx" +#include "LocalOpen.hxx" #include "plugins/RewindInputPlugin.hxx" +#include "fs/Traits.hxx" +#include "fs/Path.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" @@ -32,6 +35,11 @@ InputStream::Open(const char *url, Mutex &mutex, Cond &cond, Error &error) { + if (PathTraitsFS::IsAbsolute(url)) + /* TODO: the parameter is UTF-8, not filesystem charset */ + return OpenLocalInputStream(Path::FromFS(url), + mutex, cond, error); + input_plugins_for_each_enabled(plugin) { InputStream *is; -- cgit v1.2.3