From e6e6a79e19a72debfd3f07c3824f6e5779f44012 Mon Sep 17 00:00:00 2001 From: Quentin Minster Date: Tue, 29 Sep 2020 23:45:27 +0200 Subject: [PATCH] Honor the TMPDIR environment variable (#266) When creating a temporary directory, use $TMPDIR as base directory if set, otherwise fall back to "/tmp". --- ldoc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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