diff --git a/Source/WPEFramework/PluginHost.cpp b/Source/WPEFramework/PluginHost.cpp index a52940406..4bee98786 100644 --- a/Source/WPEFramework/PluginHost.cpp +++ b/Source/WPEFramework/PluginHost.cpp @@ -576,7 +576,14 @@ POP_WARNING() if (_config->MessagingCategoriesFile()) { - messagingSettings = Core::Directory::Normalize(Core::File::PathName(options.configFile)) + _config->MessagingCategories(); + string messagingCategories = _config->MessagingCategories(); + + if (Core::File::IsPathAbsolute(messagingCategories)) { + messagingSettings = messagingCategories; + } + else { + messagingSettings = Core::Directory::Normalize(Core::File::PathName(options.configFile)) + messagingCategories; + } std::ifstream inputFile (messagingSettings, std::ifstream::in); std::stringstream buffer; @@ -641,7 +648,7 @@ POP_WARNING() ReportingSettings WarningReporting; } gc; - gc.FromString(_config->MessagingCategories()); + gc.FromString(messagingSettings); WarningReporting::WarningReportingUnit::Instance().Defaults(gc.WarningReporting.Settings.Value()); #endif diff --git a/Source/core/FileSystem.h b/Source/core/FileSystem.h index 1e5c9aa40..03b8b414d 100644 --- a/Source/core/FileSystem.h +++ b/Source/core/FileSystem.h @@ -198,6 +198,14 @@ namespace Core { return (result); } + inline static bool IsPathAbsolute(const string& path) + { +#ifdef __WINDOWS__ + return ((path.size() > 0 && (path[0] == '\\' || path[0] == '/')) || (path.size() > 2 && path[1] == ':' && (path[2] == '\\' || path[2] == '/'))); +#else + return (path.size() > 0 && path[0] == '/'); +#endif + } inline static string Extension(const string& name) { string result;