We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 710bd7f commit efa1439Copy full SHA for efa1439
doc/generic/pgf/extract.lua
@@ -89,15 +89,8 @@ local extractor = lpeg.P{"document",
89
90
-- get the basename and extension of a file
91
local basename = function(file)
92
- local stripper = P{"stripext",
93
- dot = P".",
94
- other = C((1 - V"dot")^0),
95
- stripext = Ct( C(V"dot"^-1) * V"other" * (V"dot" * V"other")^0 )
96
- }
97
- local matches = lpeg.match(stripper, file)
98
- local ext = table.remove(matches)
99
- local basename = table.concat(matches)
100
- return basename, ext
+ local basename, ext = string.match(file, "^(.+)%.([^.]+)$")
+ return basename or "", ext or file
101
end
102
103
-- Main loop
0 commit comments