diff options
author | Pixel <pixel@nobis-crew.org> | 2008-10-15 18:10:13 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2008-10-15 18:10:13 -0700 |
commit | df9e297708d838de8cf5f2effcd7eaa16c213dda (patch) | |
tree | 585a0f2b6d280405d188b9e8930c7f055009b2b2 /lib/LuaRegex.cc | |
parent | ab4700c941b95a3c7f6c19b42a1e0e2b35e1fe81 (diff) |
Fixing an awful lot of typos / mistakes.
Diffstat (limited to 'lib/LuaRegex.cc')
-rw-r--r-- | lib/LuaRegex.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/LuaRegex.cc b/lib/LuaRegex.cc index 00c44ee..e785195 100644 --- a/lib/LuaRegex.cc +++ b/lib/LuaRegex.cc @@ -88,8 +88,8 @@ void LuaRegex::pushstatics(Lua * L) throw (GeneralException) { #define MAX_MATCHES 64 -int sLua_Regex::Regex_proceed(Lua * L, int n, Regex * r, int caller) { - int r = 0, i, n; +int sLua_Regex::Regex_proceed(Lua * L, int n, Regex * reg, int caller) { + int i, num; bool m; String s; regmatch_t pmatches[MAX_MATCHES]; @@ -97,29 +97,28 @@ int sLua_Regex::Regex_proceed(Lua * L, int n, Regex * r, int caller) { switch (caller) { case REGEX_MATCH: s = L->tostring(2); - L->push(m = r->Match(s, MAX_MATCHES, pmatches)); + L->push(m = reg->Match(s, MAX_MATCHES, pmatches)); if (!m) return 1; L->newtable(); - n = 1; + num = 1; for (i = 0; i < MAX_MATCHES; i++) { if (pmatches[i].rm_so == -1) continue; - L->push((lua_Number) n++); + L->push((lua_Number) num++); L->newtable(); L->push("start"); - L->push((lua_Number) patches.rm_so + 1); + L->push((lua_Number) pmatches[i].rm_so + 1); L->settable(); L->push("size"); - L->push((lua_Number) patches.rm_eo - patches.rm_so); + L->push((lua_Number) pmatches[i].rm_eo - pmatches[i].rm_so); L->settable(); L->settable(); } - r = 2; - break; + return 2; } - return r; + return 0; } int sLua_Regex::Regex_proceed_statics(Lua * L, int n, int caller) { |