diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-08-29 19:49:06 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-08-29 19:49:06 -0700 |
| commit | 77ebe2fb2a7f6508437f1560af031eb8abd4672b (patch) | |
| tree | 9f4a0ee57f3c07f61f0f7511f250bf80016302a8 | |
| parent | 70b8ee907076e0a9520063cfcbe710f857105d79 (diff) | |
Fix for "\000123" getting compiled to Lua as "\0123"
| -rw-r--r-- | utils.lua | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |
