Commit 035f986a authored by Max Kellermann's avatar Max Kellermann

config/File: support absolute paths in "include"

parent b168a9d4
...@@ -176,12 +176,13 @@ ReadConfigFile(ConfigData &config_data, BufferedReader &reader, Path directory) ...@@ -176,12 +176,13 @@ ReadConfigFile(ConfigData &config_data, BufferedReader &reader, Path directory)
assert(name != nullptr); assert(name != nullptr);
if (StringIsEqual(name, "include")) { if (StringIsEqual(name, "include")) {
// TODO: allow absolute path specifications
// TODO: detect recursion // TODO: detect recursion
// TODO: Config{Block,Param} have only line number but no file name // TODO: Config{Block,Param} have only line number but no file name
// TODO: support wildcards (include "conf.d/*.conf") // TODO: support wildcards (include "conf.d/*.conf")
// TODO: add "include_optional" // 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; continue;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment