aboutsummaryrefslogtreecommitdiff
path: root/core/ui.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2015-01-15 16:12:16 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2015-01-15 16:12:16 -0500
commit14ee3e0bf143916f29b2fb05465b9e79707f4611 (patch)
treee244efae02ea8553dafd98006577cc19a79314fd /core/ui.lua
parent5fa443cda192a00b6e4d220b9835f2d366fdadb6 (diff)
downloadtextadept-14ee3e0bf143916f29b2fb05465b9e79707f4611.tar.gz
textadept-14ee3e0bf143916f29b2fb05465b9e79707f4611.zip
Fix opening network path files on Win32.
Thanks to Daniel Wutke.
Diffstat (limited to 'core/ui.lua')
-rw-r--r--core/ui.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/ui.lua b/core/ui.lua
index da6e04a1..46e1c311 100644
--- a/core/ui.lua
+++ b/core/ui.lua
@@ -303,7 +303,8 @@ events_connect(events.URI_DROPPED, function(utf8_uris)
uri = uri:match('^file://([^\r\n]+)'):gsub('%%(%x%x)', function(hex)
return string.char(tonumber(hex, 16))
end)
- if WIN32 then uri = uri:sub(2, -1) end -- ignore leading '/'
+ -- In WIN32, ignore a leading '/', but not '//' (network path).
+ if WIN32 and not uri:match('^//') then uri = uri:sub(2, -1) end
local mode = lfs.attributes(uri, 'mode')
if mode and mode ~= 'directory' then io.open_file(uri) end
end