Skip to content

Commit

Permalink
modns: paths.lua: [-] fix lack of leading capital letters in java-sty…
Browse files Browse the repository at this point in the history
…le path patterns
  • Loading branch information
thetaepsilon committed Feb 10, 2019
1 parent 9877e6a commit 95c1b8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modns/paths.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ enum_pathtype.uri = {
-- we can't specify * on () in lua patterns.
-- and we can't have any external deps when *we are* the dependency loader.
-- instead, use a simpler initial test and validate more closely by splitting and checking the package levels.
local javamatch = "^[a-z][a-zA-Z0-9_.]*$"
local javamatch = "^[a-zA-Z][a-zA-Z0-9_.]*$"
interface.patterns.javamatch = javamatch
local java_handler = function(path)
local tokens = strutil.split(path, ".", true)
if #tokens < 1 then return nil end
for _, token in ipairs(tokens) do
if #token == 0 then return nil end
-- note absence of dot separator
if token:find("^[a-z][a-zA-Z0-9_]*$") == nil then return nil end
if token:find("^[a-zA-Z][a-zA-Z0-9_]*$") == nil then return nil end
end
return tokens
end
Expand Down

0 comments on commit 95c1b8a

Please sign in to comment.