about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xnotyet10
1 files changed, 6 insertions, 4 deletions
diff --git a/notyet b/notyet
index f1b9249..712ccc2 100755
--- a/notyet
+++ b/notyet
@@ -144,10 +144,12 @@ def parse(io, filename=nil)
 
       if desc =~ /^#exec\s+(.+)/
 # - error handling for #exec
-        IO.popen($1) { |f|
-          sub = parse(f, $1)
-          sub.reindent(i+2)
-          children = sub.children
+        Dir.chdir(File.dirname(fname)) {
+          IO.popen($1) { |f|
+            sub = parse(f, $1)
+            sub.reindent(i+2)
+            children = sub.children
+          }
         }
         next  if children.empty?
       elsif desc =~ /^#include\s+(\S+)/