From 035f986a91c715caeacda0b36284c15dffe3fdef Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@musicpd.org>
Date: Wed, 18 Jul 2018 13:09:04 +0200
Subject: [PATCH] config/File: support absolute paths in "include"

---
 src/config/File.cxx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/config/File.cxx b/src/config/File.cxx
index 2ac3b814f..89c57fc9a 100644
--- a/src/config/File.cxx
+++ b/src/config/File.cxx
@@ -176,12 +176,13 @@ ReadConfigFile(ConfigData &config_data, BufferedReader &reader, Path directory)
 		assert(name != nullptr);
 
 		if (StringIsEqual(name, "include")) {
-			// TODO: allow absolute path specifications
 			// TODO: detect recursion
 			// TODO: Config{Block,Param} have only line number but no file name
 			// TODO: support wildcards (include "conf.d/*.conf")
 			// TODO: add "include_optional"
-			ReadConfigFile(config_data, directory / AllocatedPath::FromUTF8Throw(ExpectValueAndEnd(tokenizer)));
+			const auto path = AllocatedPath::Apply(directory,
+							       AllocatedPath::FromUTF8Throw(ExpectValueAndEnd(tokenizer)));
+			ReadConfigFile(config_data, path);
 			continue;
 		}