diff --git a/ldoc.lua b/ldoc.lua index 8a2e6db..b2d83dc 100644 --- a/ldoc.lua +++ b/ldoc.lua @@ -791,7 +791,7 @@ local builtin_style, builtin_template = match_bang(args.style),match_bang(args.t if builtin_style or builtin_template then -- '!' here means 'use built-in templates' local user = path.expanduser('~'):gsub('[/\\: ]','_') - local tmpdir = path.join(path.is_windows and os.getenv('TMP') or '/tmp','ldoc'..user) + local tmpdir = path.join(path.is_windows and os.getenv('TMP') or (os.getenv('TMPDIR') or '/tmp'),'ldoc'..user) if not path.isdir(tmpdir) then lfs.mkdir(tmpdir) end