mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-29 22:10:27 +00:00
Write more redbean unit tests
- Fix DescribeSigset() - Introduce new unix.rmrf() API - Fix redbean sigaction() doc example code - Fix unix.sigaction() w/ more than two args - Improve redbean re module API (non-breaking) - Enhance Lua with Python string multiplication - Make third parameter of unix.socket() default to 0
This commit is contained in:
parent
c5b9902ac9
commit
1c83670229
20 changed files with 738 additions and 204 deletions
14
third_party/lua/lstrlib.c
vendored
14
third_party/lua/lstrlib.c
vendored
|
@ -320,12 +320,22 @@ static int arith_sub (lua_State *L) {
|
|||
}
|
||||
|
||||
static int arith_mul (lua_State *L) {
|
||||
return arith(L, LUA_OPMUL, "__mul");
|
||||
if (lua_isinteger(L, 2)) {
|
||||
// [jart] python multiply string operator
|
||||
lua_pushcfunction(L, str_rep);
|
||||
lua_pushvalue(L, 1);
|
||||
lua_pushvalue(L, 2);
|
||||
lua_call(L, 2, 1);
|
||||
return 1;
|
||||
} else {
|
||||
return arith(L, LUA_OPMUL, "__mul");
|
||||
}
|
||||
}
|
||||
|
||||
static int arith_mod (lua_State *L) {
|
||||
int i, n;
|
||||
if (lua_istable(L, 2)) { // [jart] python printf operator
|
||||
if (lua_istable(L, 2)) {
|
||||
// [jart] python printf operator
|
||||
lua_len(L, 2);
|
||||
n = lua_tointeger(L, -1);
|
||||
lua_pop(L, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue