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:
Francesco Abbate
2021-07-15 18:01:17 -04:00
committed by Adam Harrison
parent 0426fc26c2
commit e1530c0951
2 changed files with 5 additions and 11 deletions
+1 -1
View File
@@ -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