util/format.lua
changeset 12043 e0a8c5b1ab4f
parent 12040 2ce06f788093
child 12044 337b489532b7
equal deleted inserted replaced
12042:4e54334febc1 12043:e0a8c5b1ab4f
    68 
    68 
    69 		if option == "s" and t == "string" and not arg:find("[%z\1-\31\128-\255]") then
    69 		if option == "s" and t == "string" and not arg:find("[%z\1-\31\128-\255]") then
    70 			-- No UTF-8 or control characters, assumed to be the common case.
    70 			-- No UTF-8 or control characters, assumed to be the common case.
    71 			return
    71 			return
    72 		elseif option == "s" and t ~= "string" then
    72 		elseif option == "s" and t ~= "string" then
    73 			args[i] = tostring(arg);
    73 			arg = tostring(arg);
       
    74 			t = "string";
    74 		end
    75 		end
    75 
    76 
    76 		if option ~= "s" and option ~= "q" and option ~= "p" then
    77 		if option ~= "s" and option ~= "q" and option ~= "p" then
    77 			-- all other options expect numbers
    78 			-- all other options expect numbers
    78 			if t ~= "number" then
    79 			if t ~= "number" then