more correct absolute path detection
[?]
Sep 11, 2022, 3:31 PM
NFI42KGXEHTNACH2CATBLJIAXJYNV2C3QBPR2ORPJZKOVEREVM7QCDependencies
- [2]
OI4FPFINsupport drawings in the source editor - [3]
ZJOSQFN6bugfix: path munging on Windows - [4]
CQYKYJJUremember window positions across restart/ctrl+e - [5]
X3CQLBTRset window title within each app - [6]
KKMFQDR4editing source code from within the app - [*]
VHQCNMARseveral more modules
Change contents
- edit in source_file.lua at line 202[2.17838]
function is_absolute_path(path)local os_path_separator = package.config:sub(1,1)if os_path_separator == '/' then-- POSIX systems permit backslashes in filenamesreturn path:sub(1,1) == '/'elseif os_path_separator == '\\' thenlocal f = path:sub(1,1)return f == '/' or f == '\\'elseerror('What OS is this? LÖVE reports that the path separator is "'..os_path_separator..'"')endendfunction is_relative_path(path)return not is_absolute_path(path)end - replacement in source.lua at line 260
local os_path_separator = package.config:sub(1,1)if filename:sub(1,1) ~= os_path_separator thenfilename = love.filesystem.getWorkingDirectory()..os_path_separator..filenameif is_relative_path(filename) thenfilename = love.filesystem.getWorkingDirectory()..'/'..filename -- '/' should work even on Windows - replacement in run.lua at line 144
local os_path_separator = package.config:sub(1,1)if filename:sub(1,1) ~= os_path_separator thenfilename = love.filesystem.getWorkingDirectory()..os_path_separator..filenameif is_relative_path(filename) thenfilename = love.filesystem.getWorkingDirectory()..'/'..filename -- '/' should work even on Windows - edit in file.lua at line 183[8.18211]
function is_absolute_path(path)local os_path_separator = package.config:sub(1,1)if os_path_separator == '/' then-- POSIX systems permit backslashes in filenamesreturn path:sub(1,1) == '/'elseif os_path_separator == '\\' thenlocal f = path:sub(1,1)return f == '/' or f == '\\'elseerror('What OS is this? LÖVE reports that the path separator is "'..os_path_separator..'"')endendfunction is_relative_path(path)return not is_absolute_path(path)end