aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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));
}
}