File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3173,15 +3173,17 @@ static std::string openHeader(std::ifstream &f, const std::string &path)
31733173template <bool expandBaseWithAbsolutePath, bool exactRelative>
31743174static std::string getRelativeFileName (const std::string &baseFile, const std::string &header)
31753175{
3176- const std::string baseFileNormalized = (expandBaseWithAbsolutePath && !isAbsolutePath (baseFile)) ? (currentDirectory () + " /" + baseFile) : baseFile;
3177- const std::string path = isAbsolutePath (header) ? header : (dirPath<true >(baseFileNormalized) + header);
3178- const std::string simplifiedPath = simplecpp::simplifyPath (path);
3176+ const std::string baseFileSimplified = simplecpp::simplifyPath (baseFile);
3177+ const std::string baseFileNormalized = (expandBaseWithAbsolutePath && !isAbsolutePath (baseFileSimplified)) ? (currentDirectory () + " /" + baseFileSimplified) : baseFileSimplified;
3178+
3179+ const std::string headerSimplified = simplecpp::simplifyPath (header);
3180+ const std::string path = isAbsolutePath (headerSimplified) ? headerSimplified : (dirPath<true >(baseFileNormalized) + headerSimplified);
31793181 if (exactRelative) {
3180- const std::string absolutePath = expandBaseWithAbsolutePath ? simplifiedPath : toAbsolutePath (simplifiedPath );
3182+ const std::string absolutePath = expandBaseWithAbsolutePath ? path : toAbsolutePath (path );
31813183 const std::string absoluteBaseFile = expandBaseWithAbsolutePath ? baseFileNormalized : toAbsolutePath (baseFileNormalized);
31823184 return extractRelativePathFromAbsolute (absolutePath, dirPath<true >(absoluteBaseFile));
31833185 }
3184- return simplifiedPath ;
3186+ return path ;
31853187}
31863188
31873189static std::string openHeaderRelative (std::ifstream &f, const std::string &sourcefile, const std::string &header)
You can’t perform that action at this time.
0 commit comments