summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-04-22 21:44:09 +1000
committerdaurnimator <quae@daurnimator.com>2018-04-22 21:44:20 +1000
commitdf769e894b7be99ccc102615b17250e19a8f86c6 (patch)
tree6c9b79595d34844338daa56834dad58264fd3244
parent668a641ee18ec3715e0fb57bab1a954362019e54 (diff)
downloadfengari-df769e894b7be99ccc102615b17250e19a8f86c6.tar.gz
fengari-df769e894b7be99ccc102615b17250e19a8f86c6.tar.bz2
fengari-df769e894b7be99ccc102615b17250e19a8f86c6.zip
src/loslib.js: cc shouldn't get reassigned
-rw-r--r--src/loslib.js5
1 files changed, 2 insertions, 3 deletions
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));
}
}