fix(utils): is_uri empty path (#2671)
This commit is contained in:
@@ -174,7 +174,7 @@ utils.is_path_hidden = function(opts, path_display)
|
|||||||
end
|
end
|
||||||
|
|
||||||
utils.is_uri = function(filename)
|
utils.is_uri = function(filename)
|
||||||
local char = string.byte(filename, 1)
|
local char = string.byte(filename, 1) or 0
|
||||||
|
|
||||||
-- is alpha?
|
-- is alpha?
|
||||||
if char < 65 or (char > 90 and char < 97) or char > 122 then
|
if char < 65 or (char > 90 and char < 97) or char > 122 then
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ describe("is_uri", function()
|
|||||||
"hello",
|
"hello",
|
||||||
"hello:",
|
"hello:",
|
||||||
"123",
|
"123",
|
||||||
|
"",
|
||||||
}
|
}
|
||||||
for _, input in ipairs(inputs) do
|
for _, input in ipairs(inputs) do
|
||||||
it(input, function()
|
it(input, function()
|
||||||
|
|||||||
Reference in New Issue
Block a user