about summary refs log tree commit diff stats
path: root/source.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-09-11 08:31:05 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-09-11 08:31:05 -0700
commit9a41c7c176aa571f5270747f690e9b4a37e27529 (patch)
tree95845ced9267487cbe536abe797b6af0e2c45319 /source.lua
parent511db8cffd808d244aa84095bcde83def48736e0 (diff)
downloadlines.love-9a41c7c176aa571f5270747f690e9b4a37e27529.tar.gz
more correct absolute path detection
Diffstat (limited to 'source.lua')
-rw-r--r--source.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/source.lua b/source.lua
index fc2ff3c..1da4467 100644
--- a/source.lua
+++ b/source.lua
@@ -257,9 +257,8 @@ function source.settings()
     Settings.source.x, Settings.source.y, Settings.source.displayindex = love.window.getPosition()
   end
   local filename = Editor_state.filename
-  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
+  if is_relative_path(filename) then
+    filename = love.filesystem.getWorkingDirectory()..'/'..filename  -- '/' should work even on Windows
   end
 --?   print('saving source settings', Settings.source.x, Settings.source.y, Settings.source.displayindex)
   return {