| 122 | |
| 123 | |
| 124 | static int str_lower (lua_State *L) { |
| 125 | size_t l; |
| 126 | size_t i; |
| 127 | luaL_Buffer b; |
| 128 | const char *s = luaL_checklstring(L, 1, &l); |
| 129 | char *p = luaL_buffinitsize(L, &b, l); |
| 130 | for (i=0; i<l; i++) |
| 131 | p[i] = tolower(uchar(s[i])); |
| 132 | luaL_pushresultsize(&b, l); |
| 133 | return 1; |
| 134 | } |
| 135 | |
| 136 | |
| 137 | static int str_upper (lua_State *L) { |
nothing calls this directly
no test coverage detected