On Sun, 23 Jan 2011, Hans Hagen wrote:
On 22-1-2011 1:20, Aditya Mahajan wrote:
A simple algorithm with assume that everything following the dot is the extension, while that is certainly not the case here. We can definitely restrict the search of extension to the last 10 or so characters of the url, but there will be cases when such heuristics will fail.
it's not that complicated ... say that you patch this way:
function schemes.cleanname(specification) return (gsub(specification.original,"[^%a%d%.]+","-")) end
local function fetch(specification) local original = specification.original local scheme = specification.scheme local cleanname = schemes.cleanname(specification)
that will be the current method. Now you can experiment with:
Can cleanname be passed as a parameter of the specification? Then we can have local cleanname = specification.cleanname or schemes.cleanname(specification) This way, I can only change the cleanname of the files that are downloaded by my module without affecting the cleanname for any other command that might want to download a file. Aditya