mudgangster

Tiny, scriptable MUD client
Log | Files | Refs | README

commit ddc055345f322d30abac153d6f082953c841ff4b
parent 5ade0bd8db1f484464ae7913f7c2f6892974b86d
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun,  3 May 2020 10:40:57 +0300

Linux fixes

Diffstat:
Mmake.lua | 3++-
Msrc/lua/script.lua | 6+++---
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/make.lua b/make.lua @@ -20,6 +20,7 @@ if config ~= "release" then end local platform_srcs, platform_libs +local gcc_ldflags = config == "release" and "" or " -lpthread" if OS == "windows" then require( "libs.lua" ) @@ -48,7 +49,7 @@ bin( "mudgangster", { rc = "src/rc", msvc_extra_ldflags = "gdi32.lib Ws2_32.lib", - gcc_extra_ldflags = "-lm -lX11 -llua", + gcc_extra_ldflags = "-lm -lX11 -llua" .. gcc_ldflags, } ) obj_dependencies( "src/script.cc", "build/lua_combined.h" ) diff --git a/src/lua/script.lua b/src/lua/script.lua @@ -1,6 +1,8 @@ local lfs = require( "lfs" ) local serialize = require( "serialize" ) +local PathSeparator = package.config:match( "^([^\n]+)" ) + local ScriptsDirs if mud.os == "windows" then ScriptsDirs = { @@ -15,14 +17,12 @@ end do local paths = { } for _, dir in ipairs( ScriptsDirs ) do - table.insert( paths, dir .. "\\?.lua" ) + table.insert( paths, dir .. PathSeparator .. "?.lua" ) end package.path = package.path .. ";" .. table.concat( paths, ";" ) end -local PathSeparator = package.config:match( "^([^\n]+)" ) - local function loadScript( name, path, padding ) local function throw( err ) if err:match( "^" .. path ) then