mirror of https://gitee.com/bigwinds/arangodb
fix calculation of relative include files - look in same directory as the current file
This commit is contained in:
parent
a5025e0b02
commit
b75a9e7be0
|
@ -23,7 +23,7 @@
|
|||
#ifndef ARANGODB_PROGRAM_OPTIONS_INI_FILE_PARSER_H
|
||||
#define ARANGODB_PROGRAM_OPTIONS_INI_FILE_PARSER_H 1
|
||||
|
||||
#include "Basics/Common.h"
|
||||
#include "Basics/FileUtils.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
@ -114,7 +114,6 @@ class IniFileParser {
|
|||
if (!basics::StringUtils::isSuffix(include, ".conf")) {
|
||||
include += ".conf";
|
||||
}
|
||||
|
||||
if (_seen.find(include) != _seen.end()) {
|
||||
LOG_TOPIC(FATAL, Logger::CONFIG) << "recursive include of file '"
|
||||
<< include << "'";
|
||||
|
@ -123,6 +122,11 @@ class IniFileParser {
|
|||
|
||||
_seen.insert(include);
|
||||
|
||||
if (! basics::FileUtils::isRegularFile(include)) {
|
||||
auto dn = basics::FileUtils::dirname(filename);
|
||||
include = basics::FileUtils::buildFilename(dn, include);
|
||||
}
|
||||
|
||||
LOG_TOPIC(DEBUG, Logger::CONFIG) << "reading include file '" << include
|
||||
<< "'";
|
||||
|
||||
|
|
Loading…
Reference in New Issue