aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lvm.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lvm.c b/lvm.c
index 62a24064..42baff32 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 1.94 2000/03/10 14:38:10 roberto Exp roberto $ 2** $Id: lvm.c,v 1.95 2000/03/10 18:37:44 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -258,18 +258,14 @@ int luaV_lessthan (lua_State *L, const TObject *l, const TObject *r, StkId top)
258} 258}
259 259
260 260
261#define setbool(o,cond) if (cond) { \
262 ttype(o) = TAG_NUMBER; nvalue(o) = 1.0; } \
263 else ttype(o) = TAG_NIL
264
265
266static void strconc (lua_State *L, int total, StkId top) { 261static void strconc (lua_State *L, int total, StkId top) {
267 do { 262 do {
268 int n = 2; /* number of elements handled in this pass (at least 2) */ 263 int n = 2; /* number of elements handled in this pass (at least 2) */
269 if (tostring(L, top-2) || tostring(L, top-1)) 264 if (tostring(L, top-2) || tostring(L, top-1))
270 call_binTM(L, top, IM_CONCAT, "unexpected type for concatenation"); 265 call_binTM(L, top, IM_CONCAT, "unexpected type for concatenation");
271 else { /* at least two string values; get as many as possible */ 266 else if (tsvalue(top-1)->u.s.len > 0) { /* if len=0, do nothing */
272 long tl = tsvalue(top-2)->u.s.len + tsvalue(top-1)->u.s.len; 267 /* at least two string values; get as many as possible */
268 long tl = tsvalue(top-1)->u.s.len + tsvalue(top-2)->u.s.len;
273 char *buffer; 269 char *buffer;
274 int i; 270 int i;
275 while (n < total && !tostring(L, top-n-1)) { /* collect total length */ 271 while (n < total && !tostring(L, top-n-1)) { /* collect total length */