about summary refs log tree commit diff stats
path: root/run.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-09-10 19:23:34 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-09-10 19:23:34 -0700
commit511db8cffd808d244aa84095bcde83def48736e0 (patch)
tree15b487e54831388a0f9c5effa3a095284d32ec98 /run.lua
parent06c784b576c401b11c6629e09c00504f8746b229 (diff)
downloadtext.love-511db8cffd808d244aa84095bcde83def48736e0.tar.gz
bugfix: path munging on Windows
Diffstat (limited to 'run.lua')
-rw-r--r--run.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/run.lua b/run.lua
index 405e7e5..188269b 100644
--- a/run.lua
+++ b/run.lua
@@ -141,8 +141,9 @@ function run.settings()
     Settings.x, Settings.y, Settings.displayindex = love.window.getPosition()
   end
   local filename = Editor_state.filename
-  if filename:sub(1,1) ~= '/' then
-    filename = love.filesystem.getWorkingDirectory()..'/'..filename  -- '/' should work even on Windows
+  local os_path_separator = package.config:sub(1,1)
+  if filename:sub(1,1) ~= os_path_separator then
+    filename = love.filesystem.getWorkingDirectory()..os_path_separator..filename
   end
   return {
     x=Settings.x, y=Settings.y, displayindex=Settings.displayindex,