| 93 | |
| 94 | |
| 95 | static int str_lower(lua_State *L) { |
| 96 | size_t l; |
| 97 | size_t i; |
| 98 | luaL_Buffer b; |
| 99 | const char *s = luaL_checklstring(L, 1, &l); |
| 100 | char *p = luaL_buffinitsize(L, &b, l); |
| 101 | for (i = 0; i < l; i++) |
| 102 | p[i] = tolower(uchar(s[i])); |
| 103 | luaL_pushresultsize(&b, l); |
| 104 | return 1; |
| 105 | } |
| 106 | |
| 107 | |
| 108 | static int str_upper(lua_State *L) { |
nothing calls this directly
no test coverage detected