util.format: Fix missing backslash in pattern
authorKim Alvefur <zash@zash.se>
Sat, 03 Jul 2021 04:24:13 +0200
changeset 11650 b6ea0148ad37
parent 11649 3be346c5b940
child 11651 0fe6a9a3676f
util.format: Fix missing backslash in pattern Made the pattern match a longer range than intended, but with no effect since those characters are not present in the 'control_symbols' table.
util/format.lua
--- a/util/format.lua	Sat Jul 03 03:24:26 2021 +0200
+++ b/util/format.lua	Sat Jul 03 04:24:13 2021 +0200
@@ -60,7 +60,7 @@
 				args[i] = dump(arg);
 				spec = "%s";
 			elseif option == "s" then
-				args[i] = tostring(arg):gsub("[%z\1-31\127]", control_symbols);
+				args[i] = tostring(arg):gsub("[%z\1-\31\127]", control_symbols);
 			elseif type(arg) ~= "number" then -- arg isn't number as expected?
 				args[i] = tostring(arg);
 				spec = "[%s]";