aboutsummaryrefslogtreecommitdiff
path: root/utils.lua
diff options
context:
space:
mode:
Diffstat (limited to 'utils.lua')
-rw-r--r--utils.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils.lua b/utils.lua
index 218a644..d45dd2d 100644
--- a/utils.lua
+++ b/utils.lua
@@ -55,7 +55,7 @@ local function repr(x, mt_behavior)
local escaped = gsub(x, "\\", "\\\\")
escaped = gsub(escaped, "\n", "\\n")
escaped = gsub(escaped, '"', '\\"')
- escaped = gsub(escaped, "[%c%z]", function(c) return "\\"..c:byte() end)
+ escaped = gsub(escaped, "[%c%z]", function(c) return ("\\%03d"):format(c:byte()) end)
return '"'..escaped..'"'
else
return tostring(x)