From df769e894b7be99ccc102615b17250e19a8f86c6 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 22 Apr 2018 21:44:09 +1000 Subject: src/loslib.js: cc shouldn't get reassigned --- src/loslib.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/loslib.js b/src/loslib.js index 462fd49..6240ed9 100644 --- a/src/loslib.js +++ b/src/loslib.js @@ -144,9 +144,8 @@ const os_date = function(L) { i++; /* skip '%' */ i = checkoption(L, s, i, cc.subarray(1)); /* copy specifier to 'cc' */ let len = luastring_indexOf(cc, 0); - if (len !== -1) - cc = cc.subarray(0, len); - let buff = strftime(to_jsstring(cc), stm); + if (len === -1) len = void 0; + let buff = strftime(to_jsstring(cc, 0, len), stm); luaL_addstring(b, to_luastring(buff)); } } -- cgit v1.2.3-70-g09d2