diff options
-rw-r--r-- | Master/texmf-dist/scripts/context/lua/luatools.lua | 3 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/context/lua/mtxrun.lua | 3 | ||||
-rw-r--r-- | Master/texmf-dist/tex/context/base/luat-inp.lua | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/context/lua/luatools.lua b/Master/texmf-dist/scripts/context/lua/luatools.lua index 89e5e0eb4db..35986137950 100644 --- a/Master/texmf-dist/scripts/context/lua/luatools.lua +++ b/Master/texmf-dist/scripts/context/lua/luatools.lua @@ -3739,7 +3739,10 @@ function input.expand_variables(instance) end if not busy then break end end + local homedir = + instance.environment[(os.type == "windows" and 'USERPROFILE') or 'HOME'] or '~' for k,v in pairs(instance.expansions) do + v = v:gsub("^~", homedir) instance.expansions[k] = v:gsub("\\", '/') end end diff --git a/Master/texmf-dist/scripts/context/lua/mtxrun.lua b/Master/texmf-dist/scripts/context/lua/mtxrun.lua index 040214178b8..0fb45cc635b 100644 --- a/Master/texmf-dist/scripts/context/lua/mtxrun.lua +++ b/Master/texmf-dist/scripts/context/lua/mtxrun.lua @@ -5815,7 +5815,10 @@ function input.expand_variables(instance) end if not busy then break end end + local homedir = + instance.environment[(os.type == "windows" and 'USERPROFILE') or 'HOME'] or '~' for k,v in pairs(instance.expansions) do + v = v:gsub("^~", homedir) instance.expansions[k] = v:gsub("\\", '/') end end diff --git a/Master/texmf-dist/tex/context/base/luat-inp.lua b/Master/texmf-dist/tex/context/base/luat-inp.lua index 63dc1d904fc..d758227c1bd 100644 --- a/Master/texmf-dist/tex/context/base/luat-inp.lua +++ b/Master/texmf-dist/tex/context/base/luat-inp.lua @@ -1042,7 +1042,10 @@ function input.expand_variables(instance) end if not busy then break end end + local homedir = + instance.environment[(os.type == "windows" and 'USERPROFILE') or 'HOME'] or '~' for k,v in pairs(instance.expansions) do + v = v:gsub("^~", homedir) instance.expansions[k] = v:gsub("\\", '/') end end |