git.iko.soy/typeable/pandoc
on master help sign in
Fixed `--filter` so it doesn't search PATH for a filter with a path.

This fixed a bug wherein `--filter ./caps.py` would run `caps.py` from the system path, even if there was a `caps.py` in the working directory.

commitb1a8f1fa1ad8a6083f0e00cf786eaeff5f10c3be authorJohn MacFarlane <jgm@berkeley.edu> dateFri 27 Jun 2014, 18:30 (12 years ago) parentb212731
1 file changed+3−1
pandoc.hs+3−1
pandoc.hs+3−1
@@ -96,7 +96,9 @@ isTextFormat s = takeWhile (`notElem` "+-") s `notElem` ["odt","docx","epub","ep
9696
9797externalFilter :: FilePath -> [String] -> Pandoc -> IO Pandoc
9898externalFilter f args' d = do
99− mbexe <- findExecutable f
99+ mbexe <- if '/' `elem` f -- don't check PATH if filter name it has a path
100+ then return Nothing
101+ else findExecutable f
100102 (f', args'') <- case mbexe of
101103 Just x -> return (x, args')
102104 Nothing -> do