diff options
author | Leah Neukirchen <leah@vuxu.org> | 2017-10-29 21:39:34 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2017-10-29 21:39:34 +0100 |
commit | 5c27f2a2bd7ecd7b86e7425ec421e4fa26a28d0b (patch) | |
tree | 68425f2d6ae34a655f5a50e9f7480914d56881a1 | |
parent | 5777cf60fa8336f165559d749d3a700c696ba20e (diff) | |
download | notyet-5c27f2a2bd7ecd7b86e7425ec421e4fa26a28d0b.tar.gz notyet-5c27f2a2bd7ecd7b86e7425ec421e4fa26a28d0b.tar.xz notyet-5c27f2a2bd7ecd7b86e7425ec421e4fa26a28d0b.zip |
resolve #include/#includeall paths relative to source file
-rwxr-xr-x | notyet | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/notyet b/notyet index 3078f58..f1b9249 100755 --- a/notyet +++ b/notyet @@ -151,14 +151,14 @@ def parse(io, filename=nil) } next if children.empty? elsif desc =~ /^#include\s+(\S+)/ - File.open(File.expand_path($1)) { |f| + File.open(File.expand_path($1, File.dirname(fname))) { |f| sub = parse(f, $1) sub.reindent(i+2) children = sub.children } next if children.empty? elsif desc =~ /^#includeall\s+(\S+)/ - Dir.glob(File.expand_path($1)) { |file| + Dir.glob(File.expand_path($1, File.dirname(fname))) { |file| File.open(file) { |f| sub = parse(f, $1) sub.reindent(i+4) |