Extra fix: Master file can include current file plus some path. This makes recursive search work when the main file is in a higher director and uses \input{dir/sub.tex} etc.