Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The function
load_include_configs
already changes the directory to the one containing the parent config. Therefore,load_include_config
trying to assemble the "full" path leads to repetition of path segments, making therealpath
call fail with ENOENT.Just calling
realpath
on the path itself from the directory with the parent configuration is sufficient, so there is no point in passingparent_dir
toload_include_config
.What was broken
When running sway with a relative path to confiig, like
sway -c tmp/sway-configs/root
, if that config includes other file withinclude other
, the file that gets included is in facttmp/sway-configs/tmp/sway-configs/other
relative to where sway was ran from. (Without such directory structure the include fails.)(oops, I forgor to write this part in the original version)
Alternatives: It would be possible to not change the directory in
load_include_configs
, but even then the actual path resolution might require a different approach I think (I am thinking aboutopenat
, but I haven't thought it through enough).