diff options
Diffstat (limited to 'lbuiltin.c')
-rw-r--r-- | lbuiltin.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbuiltin.c,v 1.91 1999/12/30 18:27:03 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.92 2000/01/19 16:50:30 roberto Exp roberto $ |
3 | ** Built-in functions | 3 | ** Built-in functions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -539,13 +539,16 @@ static int sort_comp (lua_State *L, lua_Object f, const TObject *a, | |||
539 | *(L->top+2) = *b; | 539 | *(L->top+2) = *b; |
540 | L->top += 3; | 540 | L->top += 3; |
541 | luaD_call(L, L->top-3, 1); | 541 | luaD_call(L, L->top-3, 1); |
542 | L->top--; | ||
543 | return (ttype(L->top) != LUA_T_NIL); | ||
542 | } | 544 | } |
543 | else { /* a < b? */ | 545 | else { /* a < b? */ |
544 | *(L->top++) = *a; | 546 | int res; |
545 | *(L->top++) = *b; | 547 | *(L->top) = *a; |
546 | luaV_comparison(L); | 548 | *(L->top+1) = *b; |
549 | res = luaV_lessthan(L, L->top, L->top+1); | ||
550 | return res; | ||
547 | } | 551 | } |
548 | return ttype(--(L->top)) != LUA_T_NIL; | ||
549 | } | 552 | } |
550 | 553 | ||
551 | static void auxsort (lua_State *L, Hash *a, int l, int u, lua_Object f) { | 554 | static void auxsort (lua_State *L, Hash *a, int l, int u, lua_Object f) { |