mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 04:09:49 +01:00
config: minor path handling fixes
This commit is contained in:
parent
4cc0e6de90
commit
42f46aeac5
2 changed files with 3 additions and 2 deletions
|
@ -1516,6 +1516,7 @@ void CConfigManager::loadConfigLoadVars() {
|
||||||
while (std::getline(ifs, line)) {
|
while (std::getline(ifs, line)) {
|
||||||
// Read line by line.
|
// Read line by line.
|
||||||
try {
|
try {
|
||||||
|
configCurrentPath = mainConfigPath;
|
||||||
parseLine(line);
|
parseLine(line);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
Debug::log(ERR, "Error reading line from config. Line:");
|
Debug::log(ERR, "Error reading line from config. Line:");
|
||||||
|
|
|
@ -130,9 +130,9 @@ std::string absolutePath(const std::string& rawpath, const std::string& currentP
|
||||||
|
|
||||||
if (value[1] == '.') {
|
if (value[1] == '.') {
|
||||||
auto parentDir = currentDir.substr(0, currentDir.find_last_of('/'));
|
auto parentDir = currentDir.substr(0, currentDir.find_last_of('/'));
|
||||||
value.replace(0, 2, parentDir);
|
value.replace(0, 2 + currentPath.empty(), parentDir);
|
||||||
} else {
|
} else {
|
||||||
value.replace(0, 1, currentDir);
|
value.replace(0, 1 + currentPath.empty(), currentDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue