瀏覽代碼

detect absolute/relative paths in pkgfs

master
XeonSquared 4 年之前
父節點
當前提交
21d71b29ba
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. +3
    -1
      lib/pkgfs.lua

+ 3
- 1
lib/pkgfs.lua 查看文件

@@ -99,7 +99,9 @@ function pkgfs.component.close(handle)
end

function pkgfs.add(fname,comp)
local fname = "/"..fnormalize(os.getenv("PWD").."/"..fname)
if fname:sub(1,1) ~= "/" then
fname = "/"..fnormalize(os.getenv("PWD").."/"..fname)
end
local f = fopen(fname,comp)
if not fname then error("unable to open file") end
print(fname)


Loading…
取消
儲存