From 226d3d372cc9c63907f88be327707f20f77e66ae Mon Sep 17 00:00:00 2001 From: steve donovan Date: Sun, 21 Aug 2011 19:01:31 +0200 Subject: [PATCH] -c option may be given relative or absolute path to configuration file; file references in this file will be relative to its position --- ldoc.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ldoc.lua b/ldoc.lua index 06f5fc3..097d1aa 100644 --- a/ldoc.lua +++ b/ldoc.lua @@ -184,8 +184,12 @@ local abspath = tools.abspath -- a special case: 'ldoc .' can get all its parameters from config.ld if args.file == '.' then local err - config_dir,err = read_ldoc_config('./'..args.config) - if err then quit("no "..quote(args.config).." found here") end + config_dir,err = read_ldoc_config(args.config) + if err then quit("no "..quote(args.config).." found") end + local config_path = path.dirname(args.config) + if config_path ~= '' then + lfs.chdir(config_path) + end config_is_read = true args.file = ldoc.file or '.' if args.file == '.' then