diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2010-03-12 13:14:34 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2010-03-12 13:14:34 +0200 |
commit | b2c0fdd69524d4eb97a5f0350fae195bf3c6c3fa (patch) | |
tree | b918fb1096500a61483b333891179d411e90d556 /otfl-font-nms.lua | |
parent | 8070e6c1b481dcd340810ddc680aaccbf4ef1997 (diff) | |
download | luaotfload-b2c0fdd69524d4eb97a5f0350fae195bf3c6c3fa.tar.gz |
LUAROCKS_UNAME_S doesn't work in tex mode
Use os.type and os.name instead, if os.name doesn't return cygwin then
luatex need to be fixed.
Diffstat (limited to 'otfl-font-nms.lua')
-rw-r--r-- | otfl-font-nms.lua | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index ba15f1c..aa958ea 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -277,33 +277,17 @@ local function load_font(filename, fontnames, status, newfontnames, newstatus, t end end --- We need to detect the OS (especially cygwin) to convert paths. -local system = LUAROCKS_UNAME_S or io.popen("uname -s"):read("*l") -if system then - if system:match("^CYGWIN") then - system = 'cygwin' - elseif system:match("^Windows") then - system = 'windows' - else - system = 'unix' - end -else - system = 'unix' -- ? -end - -fonts.system = system - -- path normalization: -- - a\b\c -> a/b/c -- - a/../b -> b -- - /cygdrive/a/b -> a:/b local function path_normalize(path) - if system ~= 'unix' then + if os.type ~= 'unix' then path = path:gsub('\\', '/') path = path:lower() end path = file.collapse_path(path) - if system == "cygwin" then + if os.name == "cygwin" then path = path:gsub('^/cygdrive/(%a)/', '%1:/') end return path |