Remove duplicate normalize_path function
Use the function defined in the "common" module. Move the check for not-nil filename from common.normalize_path to core.open_doc. In this latter the filename can be nil if a new unnamed document is created.
This commit is contained in:
committed by
Adam Harrison
parent
0426fc26c2
commit
e1530c0951
@@ -258,7 +258,7 @@ end
|
||||
|
||||
|
||||
function common.normalize_path(filename)
|
||||
if filename and PATHSEP == '\\' then
|
||||
if PATHSEP == '\\' then
|
||||
filename = filename:gsub('[/\\]', '\\')
|
||||
local drive, rem = filename:match('^([a-zA-Z])(:.*)')
|
||||
return drive and drive:upper() .. rem or filename
|
||||
|
||||
Reference in New Issue
Block a user