From 5c27f2a2bd7ecd7b86e7425ec421e4fa26a28d0b Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sun, 29 Oct 2017 21:39:34 +0100 Subject: resolve #include/#includeall paths relative to source file --- notyet | 4 ++-- 1 file 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) -- cgit 1.4.1