diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-26 14:49:28 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-26 14:49:28 -0200 |
| commit | 9107dd115ce2ddf6cee2610daffaf7fb29133d9f (patch) | |
| tree | 7bde486836ced1f084c55772c86b39f509f9694d | |
| parent | dc4c459546e82a66b3eb22b63701fabb8f8d4fd8 (diff) | |
| download | lua-9107dd115ce2ddf6cee2610daffaf7fb29133d9f.tar.gz lua-9107dd115ce2ddf6cee2610daffaf7fb29133d9f.tar.bz2 lua-9107dd115ce2ddf6cee2610daffaf7fb29133d9f.zip | |
no more compatibility code for 'string.gfind'
| -rw-r--r-- | lstrlib.c | 8 | ||||
| -rw-r--r-- | luaconf.h | 10 |
2 files changed, 3 insertions, 15 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lstrlib.c,v 1.143 2009/06/18 16:51:03 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.144 2009/11/24 12:05:44 roberto Exp roberto $ |
| 3 | ** Standard library for string operations and pattern-matching | 3 | ** Standard library for string operations and pattern-matching |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -774,7 +774,7 @@ static int str_format (lua_State *L) { | |||
| 774 | strfrmt = scanformat(L, strfrmt, form); | 774 | strfrmt = scanformat(L, strfrmt, form); |
| 775 | switch (*strfrmt++) { | 775 | switch (*strfrmt++) { |
| 776 | case 'c': { | 776 | case 'c': { |
| 777 | sprintf(buff, form, (int)luaL_checknumber(L, arg)); | 777 | sprintf(buff, form, luaL_checkint(L, arg)); |
| 778 | break; | 778 | break; |
| 779 | } | 779 | } |
| 780 | case 'd': case 'i': | 780 | case 'd': case 'i': |
| @@ -860,10 +860,6 @@ static void createmetatable (lua_State *L) { | |||
| 860 | */ | 860 | */ |
| 861 | LUAMOD_API int luaopen_string (lua_State *L) { | 861 | LUAMOD_API int luaopen_string (lua_State *L) { |
| 862 | luaL_register(L, LUA_STRLIBNAME, strlib); | 862 | luaL_register(L, LUA_STRLIBNAME, strlib); |
| 863 | #if defined(LUA_COMPAT_GFIND) | ||
| 864 | lua_getfield(L, -1, "gmatch"); | ||
| 865 | lua_setfield(L, -2, "gfind"); | ||
| 866 | #endif | ||
| 867 | createmetatable(L); | 863 | createmetatable(L); |
| 868 | return 1; | 864 | return 1; |
| 869 | } | 865 | } |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: luaconf.h,v 1.116 2009/11/24 12:05:44 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.117 2009/11/26 11:39:20 roberto Exp roberto $ |
| 3 | ** Configuration file for Lua | 3 | ** Configuration file for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -356,14 +356,6 @@ | |||
| 356 | */ | 356 | */ |
| 357 | #define LUA_COMPAT_API | 357 | #define LUA_COMPAT_API |
| 358 | 358 | ||
| 359 | |||
| 360 | /* | ||
| 361 | @@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name. | ||
| 362 | ** CHANGE it to undefined as soon as you rename 'string.gfind' to | ||
| 363 | ** 'string.gmatch'. | ||
| 364 | */ | ||
| 365 | #define LUA_COMPAT_GFIND | ||
| 366 | |||
| 367 | /* | 359 | /* |
| 368 | @@ LUA_COMPAT_DEBUGLIB controls compatibility with preloading | 360 | @@ LUA_COMPAT_DEBUGLIB controls compatibility with preloading |
| 369 | @* the debug library. | 361 | @* the debug library. |
