examples/mime-type.lua
changeset 102 f3d9d9e67ee4
parent 101 98488a7e6a48
equal deleted inserted replaced
101:98488a7e6a48 102:f3d9d9e67ee4
    34 else
    34 else
    35 	for l in h:lines () do
    35 	for l in h:lines () do
    36 		local mtype, exts = l:match ( '^([%S]+)%s+(%S.*)$' )
    36 		local mtype, exts = l:match ( '^([%S]+)%s+(%S.*)$' )
    37 		if mtype then
    37 		if mtype then
    38 			for ext in exts:gmatch ( '%S+' ) do
    38 			for ext in exts:gmatch ( '%S+' ) do
    39 				print ( ("Adding type %s for extension %s"):format ( mtype, ext ) )
       
    40 				db[ext] = mtype
    39 				db[ext] = mtype
    41 			end
    40 			end
    42 		end
    41 		end
    43 	end
    42 	end
    44 	h:close ()
    43 	h:close ()