aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lstrlib.c8
-rw-r--r--luaconf.h10
2 files changed, 3 insertions, 15 deletions
diff --git a/lstrlib.c b/lstrlib.c
index 6ad7ca69..c25aa34f 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -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*/
861LUAMOD_API int luaopen_string (lua_State *L) { 861LUAMOD_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}
diff --git a/luaconf.h b/luaconf.h
index d39ef106..c68ce3da 100644
--- a/luaconf.h
+++ b/luaconf.h
@@ -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.