diff options
author | 2020-05-24 13:16:05 -0400 | |
---|---|---|
committer | 2020-05-24 13:16:05 -0400 | |
commit | 06f7a36d5fa444d15b3b66799b547cac57d9abc7 (patch) | |
tree | d1deac0aa6a9195c95b3b7e5bd8ebafa8041d685 /core | |
parent | 72a0869cabbf22d703d81f1e51db248e4f311d93 (diff) | |
download | textadept-06f7a36d5fa444d15b3b66799b547cac57d9abc7.tar.gz textadept-06f7a36d5fa444d15b3b66799b547cac57d9abc7.zip |
Always use capital drive letters when opening files in Windows.
Since Windows filenames are case-insensitive, mismatched drive letter case may
cause the same file to be open twice.
Diffstat (limited to 'core')
-rw-r--r-- | core/lfs_ext.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/lfs_ext.lua b/core/lfs_ext.lua index 59318da8..abf74dc0 100644 --- a/core/lfs_ext.lua +++ b/core/lfs_ext.lua @@ -124,7 +124,9 @@ end function lfs.abspath(filename, prefix) assert_type(filename, 'string', 1) assert_type(prefix, 'string/nil', 2) - if WIN32 then filename = filename:gsub('/', '\\') end + if WIN32 then + filename = filename:gsub('/', '\\'):gsub('^%l:[/\\]', string.upper) + end if not filename:find(not WIN32 and '^/' or '^%a:[/\\]') and not (WIN32 and filename:find('^\\\\')) then if not prefix then prefix = lfs.currentdir() end |